Hung Truong: The Blog!

  • May 07, 2007

    The Facebook API: Somewhat Disappointing

    I had read a few months back or so about Facebook coming up with a developer API. I hadn’t really felt like trying anything with it until recently when I heard about the FQL (like SQL for Facebook) Query language being created.

    Anyway, I tried to think of a few ideas for mini-apps using the API, and today I finally got around to messing with it. I hit a roadblock pretty quickly, though. Apparently Facebook’s API will let you find all of the current user’s friends, but it won’t let you see all of the friends of any other user. This seriously limits the capabilities of the API by a whole lot.

    This sort of makes sense. If the API let you see more than a logged in user could, that user could theoretically get past privacy setting that are in place. However, the API just blocks all queries that try to find all friends of anyone other than yourself. When logged in, you can see this info, so I don’t see the harm in offering it in the API.

    What this means is that there’s no way to really “traverse graphs” with the API. You only get info on the user’s immediate friends. Thus, any application using the API is really only rehashing or using data that is already available on the main site. That’s fine for simple applications that can sync your address book to Facebook or let you rate how hot your friends are.

    But Facebook is a social networking site. The interesting applications require some kind of access to the graph data of the site. It’s really disappointing to see that the API limits this so much.

    I really would’ve liked to see a bit more capability with the Facebook API. If Facebook really wants developers to come up with interesting and complex applications, I’d suggest opening it up a bit more.

  • May 06, 2007

    Seriously, What Is The Deal With Twitter!?

    twitter.jpg

    So I’ve been reading about this thing called Twitter on some web 2.0 sites and whatnot. Call me pessimistic but it sounds like a completely useless idea. Now, before I had heard about twitter, I had used this thing called “status updates” on Facebook. I guess they’re pretty similar.

    On Twitter and Facebook, you can write updates on what you’re doing, either from your phone or your computer. I think the difference is that Twitter sends updates to your friends on what you’re doing by SMS or whatever. Facebook just sorta posts your status on the site.

    Now, I actually use the Facebook updates now and then, but it seems like people who use Twitter do this to the max. Like they update multiple times a day. Are these people so self-centered that they think everyone needs to know what they’re doing?

    I think the difference between this functionality in Facebook and in Twitter is this: In Facebook, it’s just that. A functionality. In Twitter, the ability to update is the entire application itself. To me, Twitter is simply a subset of what Facebook already provides. Why would you ever need both?

    The only thing I can see that Twitter does better is leaving out the required “is” that facebook stick in the updates. So I can write “Hung Truong likes cheese” rather than “Hung Truong is liking cheese.” Screw gerunds!

    Regardless, Twitter seems to be insanely popular. At least with web 2.0 blogs. For now I’ll stick to updating with Facebook, like every few days or so…

  • 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 />