This weekend, I participated in HackU, a Yahoo! sponsored event that happens at various campuses around the country. Throughout this past week, Yahoo! came to UofM, and I had the opportunity to participate in the competition.
For me, the events started on Wednesday March 18 when Rasmus Lerdorf, the creator of PHP, spoke in two of my classes. First, he revealed to the class how insecure and vulnerable a very basic University site is to hackers. Then, he took questions from the class. He provided me with some advice on working with open source projects, and gave some interesting responses to all inquiring students. Because Ramus came to my class that day, I had an increased awareness of Yahoo!’s presence on ca
Later that night, I was waiting to participate in my first “Coffee House Coders” session at Mujo (in the Duderstadt), and remembered that Yahoo! was having an event on campus, which undoubtedly meant free food. I walked in a little late, but just in time for dinner. I sat down, and listened to a presentation that discussed SearchMonkey, which I had heard about before, and YQL, which was soon to become my new best friend. I spent about an hour after the talk speaking with both Rasmus and Paul Tarjan about opportunities involving YQL and the geo-location APIs that Yahoo! created. I left with the seeds of an idea freshly planted, which would later grow into a winning HackU hack.
That night at “Coffee House Coders” I proceeded to investigate what I could do for my hack. I have been working with an open source mapping library for the iPhone this semester, called Route-Me, and I knew that with it I would be able to do some cool stuff. I spoke to Tom Croucher about some of the mapping APIs and eventually found a way to incorporate Yahoo! maps into my project. My hack idea had sprouted.
I arrived at the UM CSE Building right around 4pm to begin hacking and talking with the various Yahoo! evangelists that were running the event. I played my first game of ‘faceball,’ and came out as the winner, beating Tom 5 to 2. After a while, I settled down with my hack and started to figure out what I could do.
My first task was to use Yahoo! to tell me where I was; using some of their reverse geo-coding APIs and some YQL I was able to convert a lat/lon coordinate into both a city name and a woeid. I knew that I wanted to use the woeid infrastructure to dig down into a town, but I never expected it to be as useful as it turned out to be. After diving into the documentation and using a hack provided by Paul Tarjan to visualize some of the woeid infrastructure, I determined that ‘Points of Interest’ and ‘Land Features’ were my destinations, and began planning my infrastructure. I ended up writing some code that would recursively search through woeids, placing ‘Points of Interest’ and ‘Land Features’ onto my map as markers, and searching through other woeids for their children . After some time, I had a fully-functioning system that could display everything that Yahoo! found interesting in the users current city.
The data for Ann Arbor showed 360 points of interest, decidedly too much data to display at once. I showed what I had to Rasmus and he suggested trying to filter the results. I quickly implemented a filter on “Schools,” “Parks,” and “Others” for my app, allowing the user to view only schools, only parks, or only other types of places.
Next, I decided to make these points more interactive. I moved from using geo-data to w
orking with BOSS, and from navigating locations to navigating data. My goal: an “I’m Feeling Lucky” query; one search result that would give me the most relevant information by providing a specific enough search to render the desired results. I already knew the city I was in, and the woeids came with the name of the various places I had marked on my map. By using YQL, I was able to quickly make the necessary query to find the Yahoo! search result that was the most valid. A bit more hacking and I had a functioning web browser view in my app and could rapidly display the site to a user.
It was now 4am, and with the help of a Red Bull I continued on into the unknown, I decided it was now time to create my first web service. I had been complaining all day that there wasn’t any way for users to add information to the woeid system, so I decided that I should either shut up or do something about it. I was in the middle of a coding competition so I had no choice but to do the latter. I signed up for an Appspot account and began to learn both how to use Python and how to deal with arguing developers. Taking advice from both Tom and Paul at the same time was quite interesting as they each had differing opinions on the correct way to implement it, but eventually I was able to get the basics of my service going. Following quite a bit of error checking, hacking, and Python developing, I had myself a rudimentary front end and the ability to spit out XML. A quick OpenTable later and I was able to deal with my data quickly and easily through YQL. I threw together a few quick parsing rules and I was able to generate new markers using my back end as the data source. Once the markers were on the map they just worked with my “I’m Feeling Lucky” scheme.
The last few hours of the event were devoted to adjusting the appearance of the app. Getting some css advice on my front end, changing my input scheme for new poeids (“Place on Earth ” IDs, my name for the user-generated woeid extension) from ‘city name and lat lon of the new point’ to ‘Address’ a much easier data entry mechanism.
After coding for 24 hours and knowing that I was one of two teams that decided to spend the entire night, I was unsure of the other projects out there. Finally getting to see the Twitter/Flickr mashup game was great, as I had been following their project the whole time. I was completely blindsided by the y!Vmail team; they had a full, working text-to-speech mail system that functioned over the phone, which came together beautifully. The awards began and the Twitter/Flickr mashup came in third. I hoped that I was among the top two as I suspected that y!Vmail was still in the running. Rasmus began to talk about how difficult it was to pick a winner and how difficult it was to compare something crazy that hadn’t been done before to something like the y!Vmail system. And then he said, “We decided to go with crazy!”.
I never though I would win the event, I just wanted the opportuninty to show that someone could do a whole lot of interesting things in a way that was unexpected and unusual. My entire system, minus the web-service, was written to run natively on the iPhone, 100% objective-c, no Java, no PHP. Personally, I believe that this made the hack more difficult, but so much more interesting to make.
If you are reading this and your school hasn’t yet done HackU, or there is a coding competition coming up, give it a shot! Even if you are uncertain. If the event is as well-run as UM’s was, you will have a whole group of people at your disposal that can help you overcome various technical difficulties, continuously point out how you can better you system and give constant encouragement. Who knows what could happen?