The best of both worlds.
Tag Archive for json
When playing with Timeline, I thaught it could be a nice interface for RSS feeds, especially for weblogs or planets.
So, I wrote an ”RSS to Timeline” service, that takes any RSS/Atom feed as an input, and translates it into the correct JSON / Timeline format. Just put the correct URL as a data source for your Timeline, and you’ll get it !
As you can see, I’ve also setup a demo service where you can see your feed in action. Everything is described in details here.
Regarding the implementation, the script is written in Python, using feedparser and mod_python. I first started in PHP with MagpieRSS, but it doesn’t provide universal methods to access feed/items informations, so the way to access content depends on the feed format. Yet, with feedparser, methods and properties are the same whatever your feed: is RSS 0.9, RSS 1.0, Atom … which is really interesting for writing universal agregators / translators.
It was also the first time I used mod_python, and I must say the Publisher handler is also very easy to use, with a templating system and interaction between the interface and the script.
Timeline first used its own XML format for data, then JSON was introduced. Yet, the JSON format needed is different from the one defined by JSON serialization of SPARQL results, as Joseki does – among others RDF stores.
I’ve wrote a function based on the original JSON one to load data formatted according to the previous specs: http://apassant.net/home/2006/07/sioc-timeline/sparqljson.js
So, now, you’ve got the choice: either load XML / JSON data into Timeline (aventually using Danny Ayers’ XSLT), or use SPARQL/XML or SPARQL/JSON loader. You don’t have any excuse anymore for not loading some data into your Timeline
So … Timeline offers another cool way to see Semantic Web in action !