I have achieved this using the Amigopod API to query all guest accounts and then used a Perl script to find the users who expire within a set time and send them an email.
The XML API call I used is below:
<methodCall>
<methodName>amigopod.guest.list</methodName>
<params>
<param>
<struct><member>
<name>details</name>
<value><int>1</int></value>
</member></struct>
</param>
</params>
</methodCall>
This is inside a HTTPS POST to https://<amigopod>/xmlrpc.php with the following headers set:
Content-Type: text/xml
Authorization: XMLRPC Username and Password set.