Mobile web applications: Fast development with Yahoo! Blueprint, YQL and Django.

mayo 4th, 2010 § 7 comments § permalink

Today I´m going to show you how to develop a nice web application for mobile devices mixing 3 of my favourites technologies: Yahoo! Blueprint, YQL and Django.

Let me present those technologies, just in case you still don´t know:

  • Yahoo! Blueprint: is the technology we use at yahoo to rock the mobile world! Create awesome services and don´t worry about the inconveniences of a environment with lots of terminals, just write your application and we at Yahoo! will take care of everything else.
  • YQL: is the abbreviation for Yahoo! Query Language. It´s a great and powerful technology that will help you ´sqlize´web services. As their leitmotiv says "SELECT * FROM INTERNET" start using YQL, select, filter, combine different data sources with just a simple query.
  • Django: is a famous web development framework written on Python. Django will help you create easy and robust web applications using the model/template/view paradigm.

Our web application

Each time I move to a new city or I´m looking for a new home, I spend lots of hours surfing the web trying to find the perfect ´sweet home´. I´d like to search for the precious home even if I´m not in front of my computer.

Today we are going to help those flat seekers, we are going to build a mobile property finder using the Nestoria web services. Check out the Nestoria api and you will understand our YQL queries.

We will retrieve the information from the Nestoria web service using YQL and will output blueprint using the Django framework,a nice application stack to develop awesome mobile applications.

What will do our mobile web application? Easy, we will present the user a simple form asking for a location where to search, a maximun price (per week) and also the minimun number of bedrooms. Once the user enter this information we will present a list with all results found, then each item from that list will point to the original web page that contains the information for each flat. Simple, but is a nice first step, if you like you can add more information to the search form or to the presentation layer.

Getting the data with YQL

As you may know, YQL is a rocking idea from Y!, it´s a way of sqlize web services, and of course it´s open. That means we can create new tables, share them, reuse other people tables etc.

Visit http://datatables.org/, and get an idea on how many people are right now building tables for lots and lots of web services. Come on! Check the tables, experiment search parameters and data combinations in the YQL console: http://developer.yahoo.com/yql/console/

For our particular case, there is a Nestoria open table so we can use this to extract the data. Here is the table code, check it, take a look to the parameters, you can perform the same actions as using the web service.

Diving into the Yahoo! world we can find another good hint, the YOS people have created lots of libraries in lots of languages to interact with all Yahoo open services, and of courses YQL is one of those services with api. So visit the project page at github and download the yos-social python library. Follow the installation instructions and let´s try to get some flat info from YQL, try this on the python console:

PYTHON:
  1.  
  2. import yahoo.yql as yql
  3. yqlQuery = "SELECT price FROM nestoria.search WHERE place_name='Pimlico' and price_max='250' and listing_type='rent' and country='uk'"
  4. yql.YQLQuery().execute(yqlQuery)
  5. {u'query': {u'count': u'20', u'lang': u'en-US', u'updated': u'2009-08-19T10:27:47Z', u'created': u'2009-08-19T10:27:47Z', u'uri': u'http://query.yahooapis.com/v1/yql?q=SELECT+price+FROM+nestoria.search+WHERE+place_name%3D%27Pimlico%27+and+price_max%3D%27250%27+and+listing_type%3D%27rent%27', u'results': {u'listings': [{u'price': u'190'}, {u'price': u'210'}, {u'price': u'225'}, {u'price': u'190'}, {u'price': u'225'}, {u'price': u'240'}, {u'price': u'250'}, {u'price': u'103'}, {u'price': u'173'}, {u'price': u'249'}, {u'price': u'225'}, {u'price': u'225'}, {u'price': u'230'}, {u'price': u'200'}, {u'price': u'230'}, {u'price': u'185'}, {u'price': u'195'}, {u'price': u'165'}, {u'price': u'250'}, {u'price': u'195'}]}, u'diagnostics': {u'user-time': u'317', u'publiclyCallable': u'true', u'url': [{u'content': u'http://datatables.org/alltables.env', u'execution-time': u'4'}, {u'content': u'http://www.datatables.org/nestoria/nestoria.search.xml', u'execution-time': u'6'}, {u'content': u'http://api.nestoria.co.uk/api?action=search_listings&encoding=xml&has_photo=1&place_name=Pimlico&price_max=250&listing_type=rent&page=0&number_of_results=20', u'execution-time': u'293'}], u'service-time': u'303', u'build-version': u'2579'}}}
  6.  

Cool, so we can get the info in a easy way. » Read the rest of this entry «

Where Am I?

You are currently browsing entries tagged with django at arde en el infierno.