Accessing API from php script running as cron job.

Kadina

Joined: 2006-04-26
Posts: 31
Posted: Wed, 2006-12-13 18:58

I'd writing a small php script to send out emails on all of the gallery activity that occurred the previous day.

Example email:
On 12/10/2006 the following changes were made to MyGallerySite.com:

UPLOADS:
5 new items were added to Album: "Family"
8 new items were added to Album: "Friends"

NEW ALBUMS:
New Album created: "Trips"

COMMENTS:
1 new comment on (itemid) in Album: "Christmas"

I understand this is not the "proper" way to add functionality to my gallery, however until a suitable notification module is added to G2 I am using this as a work around. I have looked at the notification module that is in development for G2 v2.2, but I would rather not have an email being sent for every event. Instead I am looking for a digest or summary format that sends an email once a day. The only way I know how to accomplish this is with a cron job, and since not all hosts support that I have my doubts on whether it will ever be available as part of the G2 core.

That said, I would love to be able to use the G2 API in my script to build urls, access db credentials, ect. Is this possible and if so, could someone point me in the right direction on how to use the core functionality of G2 in a standalone script?

Thanks!

 
Kadina

Joined: 2006-04-26
Posts: 31
Posted: Mon, 2007-04-09 00:53

I'm still looking for some help with this. Right now my script is working fine, but I would like to include urls in the email pointing to the albums with changes. If I know the ItemID, how can I build the url, either by hand or using the Gallery API? Anyone?

Thanks.