How do i integrate spgm script with wordpress

I have a php script called spgm which I love. It’s simple and does the job of displaying galleries on a specified page. How do I integrate spgm with wordpress?

Thank you

Mary