Skip to content

Instantly share code, notes, and snippets.

@ychaouche
Created August 28, 2012 16:10
Show Gist options
  • Save ychaouche/3499609 to your computer and use it in GitHub Desktop.
Save ychaouche/3499609 to your computer and use it in GitHub Desktop.
function YRSSReader(){ // Yahoo! RSS Reader
this.feed_url = "http://rss.news.yahoo.com/rss/topstories";
this.items = [];
this.callback = AjxCallback(this,this.simpleResponseHandler);
}
YRSSReader.prototype = new ZmZimletBase();
YRSSReader.prototype.constructor = YRSSReader;
// Handle de la réponse à la requête XHR en cas de succès
// Version simple (appel de this.sendRequest)
YRSSReader.prototype.simpleResponseHandler = function (){
console.debug("result received");
};
YRSSReader.prototype.getFeed = function () {
// sendRequest(requestStr, serverURL, requestHeaders, callback, useGet, passErrors)
console.debug("about to send request");
this.sendRequest("",this.feed_url,null,AjxCallback(this,this.simpleResponseHandler));
console.debug("request sent");
}
reader = new YRSSReader();
reader.getFeed();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment