Winnow My Bloglines Down

Serendipitous discovery (as opposed to total information awareness)
About    Architecture    Download    Settings
Mark All As Read
Show All Subsciptions
    Bloglines Login:     Reset All Settings:

About

Keeping up with the thoughts and work of many people through Bloglines is becoming an overwhelming task. What I am looking for is serendipitous discovery, not total information awareness!

So I built Winnow My Bloglines, a utility that connects to the Bloglines web service and winnows down the entries. Initially, the Winnow performs a very simple random selection of one item per creator. This scheme basically gets the job done, but I plan to improve it over time.

Let me know what you think, especially if you intend to build upon these ideas.

- Jamie

Architecture

This is a basic explanation of the control-flow of the application.

Local Settings

Bloglines requires HTTP Basic Authentication, and my app needs to store some other settings for the user, so I worked out a way to load a global object with data from a cookie.

A Client (Mostly) Written In Javascript

The generation of both the subscriptions list and the blog entries display both depend on XML retrieved from the Bloglines API. I use XHR (attempting not to use the A-word here) in order to interact with web services.

The majority of the work occurs from within a callback function that is hung on the onreadystatechange. This ensures that the rendering occurs after the request and response cycle has completed. Major functions and flows:

		initialize
				
		listSubscriptions
			XHR to ws
			onreadystatechange callback:
				xml from response
				processOpml
				renderSubscriptions
						
		listItems
			XHR to ws
			onreadystatechange callback:
				xml from response
				processRss
				winnowItems
				renderItems		
		

Perl Proxy

I cannot tap the Bloglines web service directly from javascript running on a Semantic Wave page (due to cross-site scripting restrictions), so I built a very simple perl proxy.

The ws.cgi script passes params from the Winnow to the listsubs and getitems web services at Bloglines, and then passes the response (hopefully containing XML content) back.

Security reminder: the Bloglines credentials are passing through the ws.cgi and then to Bloglines without any encryption.

Javascript DOM

Once the XML has been retrieved, DOM calls are used to generate javascript objects from the data. These objects are then passed onto render functions to generate the html.

UI

The content generated is written to divs via the innerHTML attribute. I used the Nifty Corners Cube javascript/css library in order to dress this app in the trendiest, Web 2.0 lustre with the absolute minimum of work.

Useful Stuff

The following resources were very useful in developing this app:
  Apple's XHR Tutorial - the best one out there, IMO   Netspade JS Cookies Example - dealing with cookies in javascript
  Bloglines API Documentation - particularly listsubs and getitems
  LWP::UserAgent
  LWP Cookbook - How to do basic Auth in Perl/LWP
  Del.icio.us Reading Lists - Danny Ayers describes his del.icio.us reader
  DOM Level 3: ECMA Script Binding - DOM traversal in javascript
  Nifty Corners Cube - curvy corners that only uses javascript and css
  JSON Javascript Cookies - not yet in use, although highly intriguing

Download

Let me know if you find any interesting bugs.

This software is licensed under The MIT License.

winnow.tar.gz