Created
September 23, 2014 16:11
-
-
Save sbcd90/c859ab9435fd4d1d4ec3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var libxmljs = require('libxmljs'); | |
var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest; | |
var xmlhttp1 = new XMLHttpRequest(); | |
xmlhttp1.open('GET','http://www.telegraphindia.com/feeds/rss.jsp?id=3',false); | |
xmlhttp1.send(); | |
var responseXML = xmlhttp1.responseText; | |
var xmldoc = libxmljs.parseXmlString(responseXML); | |
var title = xmldoc.find('//title'); | |
var description = xmldoc.find('//description'); | |
debugger; | |
for(var count=0;count<title.length;count++){ | |
console.log(title[count].text()); | |
console.log(' '); | |
if(description[count]!=undefined) | |
console.log(description[count].text()); | |
} | |
var xmlhttp2 = new XMLHttpRequest(); | |
xmlhttp2.open('GET','http://www.telegraphindia.com/feeds/rss.jsp?id=8',false); | |
xmlhttp2.send(); | |
responseXML = xmlhttp2.responseText; | |
xmldoc = libxmljs.parseXmlString(responseXML); | |
var title = xmldoc.find('//title'); | |
var description = xmldoc.find('//description'); | |
debugger; | |
for(var count=0;count<title.length;count++){ | |
console.log(title[count].text()); | |
console.log(' '); | |
if(description[count]!=undefined) | |
console.log(description[count].text()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment