domenica 15 aprile 2012

Some anticipation of the first application (PT1) - Facebook Desktop Notifier


From two previous post, we understood that a primary goal of our works is INTEGRATE application. Now we would make things more interesting, (as possible). Let's start with a simple example: this first example is far to the reality, but is interesting (also for me) to see the behaviour of the library in a simple real situation

Ok, let's start!

Now we suppose that we want to manage Facebook notifications, through rss format (see http://www.kristi-barrow.com/facebook-rss-feeds-what-is-available/ ; facebook make it able an xml page with some notification,   reachable through a simple secure link). On the other hand, suppose that we have a little client that can manage some kind of notification, but not in RSS format.

This application expects to receives the 'number' of notifications that are not yet been read, , contacting directly facebook. However, facebook doesn't provide this service: it allows only to receive the rss file.

How we can manage this situation? From my point of view, we could integrate these application through a connector :) In an informal way, we can follow these steps: we fetch the rss notifications from facebook, adapt the informations (with the connector) and provide its to the client. Ok, let's start to see how do it!

The first step can be resolved by defining a simple https connection to the specific link (http://www.new.facebook.com/feeds/notifications.php?id=your_facebook_id&viewer=your_facebook_id&key=your_internal_key&format=rss20). This step are solved by the client application

Ok, now we can continue with the second step. In this step we practically define our connector.

This connector must transform the xml file into a big 'Rss' Object. To do this, we can define a translator primitive (we discussed it in the previous post) that consume from the xml file e, through  the transforming logic (that consist of an Rss parser) converts the file into a RSS Object (we can use the rss lib utils).

Finally, this translator write the result of the transformation - a simple number - on a txt file; this file will be read by the client application, that on own will notify the user of this new information

This is the result 
(Simple System Tray Icon)

Nexts posts will explain step by step how obtain things like these :).. Stay tuned

1 commento:

  1. If someone interested about a preview of this application, contact me! I'm triying to customize it :)

    RispondiElimina