Sign in to follow this  
  • entries
    34
  • comments
    29
  • views
    17573

Web 2.0 Goodness

Sign in to follow this  
Dovyman

276 views

Last week Kent Brewster of Yahoo came to my programming studio class and challenged us to develop a web application in the spirit of the annual Yahoo Hack Day. This being my first lengthy exposure to javascript and AJAX, it took a little bit to pick up (and the code isn't as clean as it could be) but I wrote a pretty neat little application called WorldTraveler. Beware that it is running on one of those freebie servers (I needed PHP and my school accounts don't allow it), so theres occasional downtime.

Basically WorldTraveler is a mashup that brings together Google Maps, Flickr and WikiTravel into a (somewhat) clean interface that lets you explore the world through words and pictures.

It works like this:
  • User clicks a location on the map.
  • The latitude and longitude are transformed into a 0.5x0.5 degree bounding box and sent via javascript to a GeoNames REST service which reverse geocodes them and returns the largest city in that area.
  • A collapsible container for that location is created.
  • javascript makes a call to the Flickr API and asks for the 30 most relevant pictures that have the city name and the tag "Travel". A slideshow image viewer is added to the location's container, which displays 3 images at a time.
  • An XMLHttpRequest is made via javascript to a PHP file on the server which in turn requests the appropriate page from WikiTravel (uses Special:Export to get an XML document that has an element containing the full wikicode for the page). The PHP script then uses a series of regular expressions to extract the "See" section from the wikicode and turn it into text and HTML, which are then grouped into an XML document and sent back to the main page and parsed into the location container.


I'd say it's not too bad for my first real attempt at doing anything special with javascript or using any web 2.0 api's. It's fairly fun to play around and look at pictures of various places, I could see where another week of work would let you view all the WikiTravel information in a nicer format. I probably will just leave it as it is though, since it's not exactly revolutionary or anything. It was fun though.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now