My first widget - Part 2
Sunday, 21. September 2008, 05:59:25
The widget uses Google App Engine as a back end server. I created what is known as a WebApp in Python. I also used the BeautifulSoup screen scraping library to scrape HTML pages for extraction of relevant information. The reason for using a back end server is to relieve the client on which the widget runs of processing burden. This widget doesn't use any XML based RSS (Really Simple Syndication) feeds. However, future versions may use them.
Python is well suited for server development since it provides a huge number of libraries on almost every technology available out there. It suited my needs perfectly for the creation of a Web2.0 mashup widget. I wrote a simple WebApp in Python and hosted it on AppEngine. The widget just basically makes AJAX (using XMLHttpRequest) requests to the WebApp. The server retrieves the appropriate HTML pages and scrapes them for the required information. It then processes this data and sends the information to the client widget. The information is a string in its final form. However, some other form such as JSON may also be used. I kept the information sent as a string since I plan on porting this same widget to mobile devices. Since, processing power is limited on such types of devices, I decided to send simple strings with HTML markup so that I can simply load it into a table or some equivalent UI mechanism.
The widget also sends information back to the server (the DD view). This demonstrates that communication is bidirectional. This opens up a host of new possibilities. For example, a user may configure user preferences. This can be sent to the Google App Engine server where it can be stored using the DataStore API thus eliminating the need for storage on the client device (which is another plus point if the widget is running on a mobile device).
Please send me feedback at earlenceferns@gmail.com

