Hi guys
I am trying to buld an rss reader for random rss feeds in javascript. I need to catch the data in an event as I am going to pass around that event. I tried realtime.co or firebase and feedthefire but, there is no result so far. If someone has a relevant link that would be great
Thanks in advance

Member Avatar
var sites = [...]; //list of all the sites you need - choose one at random
var site = sites[Math.floor(Math.random() * sites.length)];

var yql = 'http://query.yahooapis.com/v1/public/yql?q=' + encodeURIComponent('select * from xml where url="' + site + '"') + '&format=xml&callback=?';

// Request that YSQL string, and run a callback function.
// Pass a defined function to prevent cache-busting.
$.getJSON(yql, function (data) {
    console.log(data.results[0]);
    //open console to see results
});

From: http://jsfiddle.net/sMavF/

Well, that's the reader returning XML data now in more manageable json format ;)

Thanks very much for the reply, I really appreciate it. I am not sure if this is a real time though. I need one with the server pushing when there is an update rather than the client pulling. I guess I need token and a backend service

Member Avatar

OK, when you said event, I assumed it was some 'event' like a 'gig' in the data content. I didn't realise that you meant 'event' coding-wise. Sorry.

Yeah, so for that you probably do need a service.

I need one with the server pushing

Unless your server runs something like node.js, pushing to the client is impossible. Long polling is the way to go.

There is one other if you have your own rss feed but not sure if this one works with random feeds http://superfeedr.com/

yeah I exactly need the server service, I tried node.js as well but no luck. I mean I need a ready service as I don t have time for testing etc.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.