Upcoming.org PHP scripts

I’ve created some very simple PHP scripts to parse the Upcoming.org XML/RSS. This is geared towards the Libertarian Party groups, as there is some custom code to link to the state group. See the example and download page.

If you are utterly confused as to what I’m talking about, please visit this earlier post.

And we’re up to 27 members, weeeeeee.

4 Comments
  1. I’ve done PHP, but not at the LP site I manage. It doesn’t look like it’s turned on there, and I prefer perl anyway.
    But our host didn’t have XML::RSS.pm or anything else from the XML CPAN modules, and just getting RSS.pm for myself wasn’t enough.

    So, faced with that, I did what any self-respecting geek would do: I reinvented the wheel. A simple one, doing just what I need it to do. From what I read: I might at well. The ‘advanced’ solutions out there break when the RSS feed is quirky.

    My solution was doing a rough parse of the feed on my site within an hour.

    The first step: fetching the RSS source.
    http://ny.lp.org/test/get-upcoming

    You need your own RSS link, found at the orange RSS button on the page you’re syndicating.

    Next step: rebuild your index page (if there were changes)
    http://ny.lp.org/test/build_index

    It’s throwing away stuff I don’t need, and cleaning up what I do.

    Results are here, still getting prettied up before launch:
    http://ny.lp.org/test/

  2. Stephen–

    I really like your script, it’s just what I’ve been looking for to parse the upcoming feed. Only problem is that my host (dreamhost) disabled the file_get_contents and allow_url_fopen functions a few months back because of security problems (apparently whatever site you’re grabbing with those functions can pass back malicious code which PHP will blindly execute locally).

    Anyways, the workaround appears to be to use a cURL function instead (http://blog.unitedheroes.net/archives/p/1630/ and http://wiki.dreamhost.com/index.php/CURL). I am totally not a programmer, and my attempts at cut and paste in the upcomingxml2simple.php file failed miserably. Any chance you’d be able to produce an alternative version of this script with cURL functions instead?