I guess not everyone reading this article is a fan of League of Legends (LoL), a famous multiplayer game in which two enemy factions are fighting each other to destroy the enemies base. Nevertheless I’ve built a website around this game – or to be more special – around the patches which are released for it. Officially Riot, the developer and publisher of LoL, just throws out some patch notes each patch, but if you are not able to keep track of each patch, you can easily get lost in the near endless changes. Often you just want to know what changed for a special hero or item. So I sat down and brewed a nice website which can be reached at http://www.lol-patch.com or http://www.lol-patch-history.com.
This site is built using the famous web technologies Ruby, Nokogiri, HAML and jQuery. Basically I do not own a Rails enabled webspace, so I decided that I just crawl the data on my local Mac, put the data into some HAML templates and generate some HTML, which gets a bit of dynamic using jQuery with its great DOM manipulation functionality.
Some words about the crawling. Basically I’m using the standard Ruby Net::HTTP classes to make simple get request to the official LoL website to gather information about which champions and items are available. After collecting the basic data I fetch all patch notes with simple HTTP GET request.
The so acquired HTML pages are parsed using the famous Nokogiri parser. So all the data comes together – champions, items, changes.
First I started off creating some custom HTML. This turned out – as always – to be too inflexible as the app grew. So I started to include HAML and built some HAML templates, which basically are saved as HTML afterwards.
Having the feeling that the site needs some search or filter function I first thought that I need some PHP on the server side. But I ended up using jQuery to filter the champions and items, which really turned out to be easy, using the built in jQuery $.each and some regular expressions.
To conclude this post I must say that all this technologies are great and I can only recommend to try them out and use them! Drop me a comment if you like a more detailed post about this topics.