Upcoming.org Events Script

Here’s my super simple upcoming.org events feed script. Nothing fancy, but it will do the job for a simple events feed like the one on this page. It’s a PHP script and it requires only the Magpie RSS-parser (simple drop install) and the expat XML-parser (included in almost every PHP-distribution out there).

I decided to go with expat since the upcoming.org PHP web services toolkit is somewhat hard to deal with if you haven’t got hosting with command line access.

In order to get the script to run, you need to figure out your upcoming.org user id and get an API key, and put those in the script where so indicated.

If you have cron support on your hosting provider you should use it. You need to use a cron task that looks something like this:
/usr/local/bin/lynx -dump http://yoursite.com/upcoming-events.php > /dev/null
Never pull events more often than every 15 minutes.