Stalking done right
Although I had turned off the Where’s Seth? for the winter break, I neglected to turn it back on again for the first couple weeks of classes. The reason was that I was using a rather… kludgy method of parsing calendar data, to say the least. The calendar was stored on my computer in iCal format. I used KOrganizer to edit it and add my classes / schedule, and then used rsync to keep it up-to-date on the server. PHPiCalendar then parsed the iCal and generated RSS. I then used XML_RSS from PEAR to parse the RSS and yoink only the current event. That’s a lot of work to pick out the current item from my schedule!
I had been lazy for a couple weeks about sitting down and inputting my new classes. So today, I fired up Google Calendar and input my schedule items just for fun. It features XML and iCal export, so I thought I could hack up an equivalent version of the Where’s Seth? script using that.
I first tried just pulling the XML data and parsing that with my script. However, it wasn’t RSS, but Atom. I didn’t feel like rewriting everything to handle Atom XML, so I then investigated the iCal format. Googling “PHP iCal parser” got nothing decent to turn up (I refuse to register at crappy sites to download questionable libraries), but searching for “parse iCal” showed a JavaScript solution. That still wasn’t ideal, but I read the comments of that blog entry to find that there was a WordPress iCal parser! It was easily to grab and install, but it only showed events that had already passed. So I hacked it up a little bit to accept feeds from multiple iCals and to only show an event if one was currently in progress; it only took about an hour from start to finish. And now I have a slick Google Calendar that I’ll be a lot more likely to keep updated than I did the silly local iCal
This, my friends, is Stalking Done Right™.
6:59 am
Hurrah. I have something to do in moments of boredom and loneliness!
11:49 am
Nice.
I recently started using Google Calendar too. I use the iCal export-thingy in my calendar applications on my two systems so I can keep it all in sync nicely. Now if only I actually used it…
I think the real stalking is to be done in that screenshot though. Anyone want to guess what all the bookmarks in the bar are? :shifty:
Is that a screenshot on Windows, BTW? Because if so, it looks like you use the exact same visual style as me (but in black, I use the blue one). Can’t remember the name of it though. Freakeh
12:45 pm
*Matthew slaps himself.
DUHHHH, of course it’s Windows. There’s the menu bar and everything there. Silly me >_<
2:22 pm
Luna Element 5.
10:43 pm
If your crappy site was phpclasses.com, then I love that site. As ugly as it is (and it’s UGLY), it’s got a ton of great stuff on there that has really helped me a lot.
Anyways, that’s it. I always wondered how the Where’s Seth worked. Now I know.
10:50 pm
I find it easiest to memories your plan.. That way when I’m in the bushes with my night vision goggles I don’t have to work about connecting to the internet.
6:35 pm
Hello,
Could you tell me where you found that ” JavaScript solution” for iCal parsing ?
Thank you.
David