From a similar question I found out about XPath and it looks incredibly fast, but I can't use it with Node.js:
> var xp = new XPathEvaluator();
ReferenceError: XPathEvaluator is not defined
at repl:1:14
at REPLServer.self.eval (repl.js:110:21)
at repl.js:249:20
at REPLServer.self.eval (repl.js:122:7)
at Interface.<anonymous> (repl.js:239:12)
at Interface.EventEmitter.emit (events.js:95:17)
at Interface._onLine (readline.js:202:10)
at Interface._line (readline.js:531:8)
at Interface._ttyWrite (readline.js:760:14)
at ReadStream.onkeypress (readline.js:99:10)
Can I somehow install it as a module? Or is there an alternative? The problem is that I'm downloading several RSS feeds with total of about 900 entries. I'm downloading them for less than a second, but iterating over each element with jQuery
$(xml).find('entry').each(function() { });
... takes 10-15 seconds, which for a web service isn't acceptable. Any suggestions?
If you need anything for node.js, hit up http://npmjs.org first, to see if it doesn't already exist. For common things like XPath traversal, it usually does. In this case: https://npmjs.org/package/xpath