Skip to content

Instantly share code, notes, and snippets.

@btk
Last active August 3, 2016 09:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save btk/dfb180b5712148c85140e54aaf5ea1ad to your computer and use it in GitHub Desktop.
Save btk/dfb180b5712148c85140e54aaf5ea1ad to your computer and use it in GitHub Desktop.
RSScrawler.js (via Json)
var getJSON = function(url, callback) {
var xhr = new XMLHttpRequest();
xhr.open("get", url, true);
xhr.responseType = "json";
xhr.onload = function() {
var status = xhr.status;
if (status == 200) {
callback(null, xhr.response);
} else {
callback(status);
}
};
xhr.send();
};
var rssUrl = "http://forum.fitekran.com/kategori/-/index.rss";
getJSON("http://rss2json.com/api.json?rss_url="+encodeURI(rssUrl), function(n, resp){
console.log(resp);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment