I have been doing some work recently with the Outline Converter, upgrading its code and adding more input and output formats. One of the benefits of this is that it can now act as a feed2json converter. Since it is hosted on Ning it doesn’t suffer from the bandwidth restrictions so many other feed2json scripts do. To use it as a feed2json use the following URL format:
http://xoxotools.ning.com/outlineconvert.php?output=json&classes=items&url=FEED URL&callback=CALLBACK
I have already upgraded my version of FreshTags to use this instead of the other feed2json script so that I no longer have to worry about the bandwidth restrictions. Here is the code for the function I am using to convert the JSON data to the Delicious.posts format:
var rtrn = [];
for(var i=0; i<json_data.items.length; i++) {
obj = {};
obj.d = json_data.items[i].title;
obj.u = json_data.items[i].link;
obj.n = ”;
if(json_data.items[i].description)
obj.n = json_data.items[i].description;
if(json_data.items[i].content)
obj.n = json_data.items[i].content;
rtrn.push(obj);
}//end for
return rtrn;
}//end feedjson2deljson
One Response
Tony Hirst •
Hi-
for your info, I am using the rss2json feature for my prototype feed driven search engine – searchfeedr – which takes the url of a user provided feed URL, grabs a json version of it and uses the link urls as limit on a user rolled search (think a feed driven rollyo).
searchfeedr – http://blogs.open.ac.uk/Maths/ajh59/searchfeedr.html (description at http://blogs.open.ac.uk/Maths/ajh59/007309.html)