Hung Truong: The Blog!

Craigslist and Google Maps Mashup Thingy: Day 2

April 06, 2007 | 1 Minute Read

google-map.gif

Today I pretty much worked on my Craigslist Google Maps app all day. I spent a lot more time getting the data that I scraped from the individual Craigslist ads into the database, and then setting up the cron script thing to periodically pick up the new feeds. To parse the RSS feeds, I just used Magpie since it was really easy.

Magpie wouldn’t parse the KML files that Google Maps uses to do its geocoding thing (where it gives you the latitude and longitude based on an address) so I had to use a regular expression. It was a pretty ugly hack, but at least it got the job done. I suppose it’s more efficient to use regular expressions rather than a full blown parser though. Maybe.

I also got the database info for the apartment ads into Google Maps using their API. It’s actually pretty simple once you understand what all the lines mean. I’m sort of weak in Javascript, so I guess this is a good chance for me to learn some more. I know Java, but I’m not used to using things like event listeners for mouse clicks and stuff like that. GUI? Who needs ‘em, right?

So I’ve got a sort of working prototype. Now all I need to do is clean it up and add more prettiness and features. Right now when you click on the map marker, you just get the description. Hopefully I can add stuff like the price, a link to the Craigslist listing, and pictures. It shouldn’t take too long, now that I’ve got the skeleton in place.