Hung Truong: The Blog!

  • May 06, 2007

    MapsKrieg – Craigslist + Google Maps Mashup Launch!

    logo.png

    I did a bit more work on MapsKrieg (the official name of my craigslist and google maps mashup) in the past few days, and I think it’s ready for initial launch now.

    If you haven’t read my previous posts on MapsKrieg, it’s a mashup that scrapes craigslist apartment listings and displays them using the Google Maps API. I’ve been on the hunt for an apartment in Ann Arbor, MI where I’m going to go to grad school. I had seen the coolness of HousingMaps, but I noticed that it only supported a very small number of cities. I figured I’d build a similar app that listed more cities, since craigslist has expanded quite a bit since that HousingMaps was created.

    If you’re wondering about the name, here’s my thought process: I was originally calling the project “Craigsmaps” since that sort of made sense. But the domain name for that name is already taken. So I came up with a bunch of other stupid Web 2.0 names that didn’t really click (Abodr, apartment.icio.us (okay, just kidding)). So I switched the “craig” and the “maps” and it became “mapscraig” which reminded me of “blitzkrieg” which became “mapskrieg.” And there you have it.

    Currently MapsKrieg supports 286 different craigslist locations. I haven’t added any areas outside the United States, though if I get requests, I’ll add them. And I’ll probably add new cities as their added to craigslist if people request them, too.

    As far as technical stuff goes, I built the site on the CakePHP framework, which was a new experience for me since I had been doing stuff in Ruby on Rails for the past year. The app uses Google Maps’ API for displaying the data that’s pulled directly from craigslist listings. Of course, all the data is cached in a MySQL database, so the site is decently fast.

    MapsKrieg took about two “man weeks” worth of time to complete. It was developed over about a month, though I didn’t work on it every day, and I didn’t work all day on the days I did work on it. I’d say that’s pretty good, considering I hadn’t really done much programming in PHP/Javascript before, and I had to learn the Google Maps API (which was surprisingly easy).

    Anyway, go ahead and try out MapsKrieg and let me know what you think. The interface could probably use some tweaking, but I think the app “works” fairly well. But I’m open to any questions or comments.

  • May 02, 2007

    Let Me Show You My Pokemans. Let Me Show You Them.

    my-pokemans1

    I guess this random image has been around for a while, but I just saw it recently. I guess its resurgence in popularity has to do with the recent release of the new Pokemon Pearl and Pokemon Diamond games for the Nintendo DS.

    I am a big fan of the cat macro images, and this one is just pure awesome. I guess the combination of cats in strange poses and bad grammar (“let me show you them!?”) is a comedy goldmine.

    Oh, that reminds me, I really should buy those new Pokemon games. I know I’ll get them eventually, so it might as well be sooner than later. It’s not like they’d drop in price or anything…

    Also, the ytmnd page of this poster has some awesome live arrangement of the Pokemon battle song. It’s sooo bad! I’m getting way too pumped listening to this.

  • May 02, 2007

    Craigslist and Google Maps Mashup Thingy: Day 14 – Getting Jquery and Prototype to Work Together

    Whoa, that’s a doozy of a title! Anyway, today I was working on making the mashup look prettier and actually somewhat usable for human consumption. I was using thickbox to get some pretty snazzy ajax stuff going on for displaying the about page and whatnot. Today, I included prototype for some even more snazzy ajax stuff. But apparently they clash.

    I guess both of them like using the ‘$’ character as a shortcut to make the code easier to read. Which means they have crazy namespace conflicts. Bad developers! Anyway, here’s how I got it to work. Right after the import of the jquery library, I set the ‘$’ thing to be ‘$j’ instead. Then I refactored thickbox to use the ‘$j’ name instead. It worked. Here’s what the head looks like:

    <br /> ...<br /> <script type="text/javascript" src="/js/jquery-latest.pack.js"></script><br /> <script>var $j = jQuery.noConflict();</script><br /> <script type="text/javascript" src="/js/thickbox.js"></script><br /> <script type="text/javascript" src="/js/prototype.js"></script><br /> ...<br />

  • May 01, 2007

    Craigslist and Google Maps Mashup Thingy: Day 12+13 – Dot Com and Cities

    So I worked on the mashup quite a bit yesterday. So much that when I was done, I was too tired to write a blog entry about it. I mostly spent yesterday buying the domain name, upgrading my server, and getting the project to work on my “production” server. It wasn’t too difficult; I just needed to move the database, change some names, and make sure there weren’t any old names being used. I also started adding all of the cities on CraigsList to the database. At least, the US ones.

    This took a lot of time to do manually. I had to figure out if the area was an actual city, or a bunch of cities, then figure out the geo coordinates, and stuff it into the database. I thought it might be faster to do it by hand than write a script. Nope.

    Today I wrote a script that would make the entry faster by automagically getting the coordinates from Google Maps’ http request service. It still took a while, but today I finished inserting almost all of the US cities (excluding the combination ones, since Google can’t do those).

    Now all that’s left is for me to make the pop up windows a little prettier, and maybe add a list of the CraigsList listings to the side for easy browsing by price, # of bedrooms, etc. That shouldn’t take too long. Then I can launch the site!

  • April 29, 2007

    Craigslist and Google Maps Mashup Thingy: Day 11 – More Random Code

    Today for the mashup thing, I did a bit of work on the main index page where each available city will show up as a marker. So when someone goes to the root of the website, they’ll see a bunch of cities. They can also pick the cities from a drop down menu, too. This required a bit of more javascript and some template files, etc.

    I did a little research on the person who did the Google Maps Craigslist mashup like two years ago. Apparently he got a job at Google! While that’s pretty awesome, I can’t see this project doing the same for me, since it’s something that’s already been done (and two years ago, which is an eternity in web time). Rather, I’m just building this for my own use and perhaps for other people who wish there were more cities available in that HousingMaps mashup.

    I came up with a name for the application. I was going to call it CraigsMaps, but someone already has that domain name. I’m thinking I should buy the domain name pretty soon, but what if I come up with a cooler name later!? The app should be ready in a couple of days anyway. Depending on how much extra stuff I want to cram in before I “launch” it.