3

I can use quantmod to get historical data and close-to-realtime quotes for stocks. I can also use quantmod to get financials data from Google. Are there any existing R packages that would let me grab Google's news feed for a given stock?

If not, is there a package for reading and parsing RSS feeds in R?

Joshua Ulrich
  • 173,410
  • 32
  • 338
  • 418
Zach
  • 29,791
  • 35
  • 142
  • 201

3 Answers3

4

Sure, RSS is after all XML, so use the XML package.

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
  • And look here for some good nuggets of info on using said package: http://stackoverflow.com/questions/1395528/scraping-html-tables-into-r-data-frames-using-the-xml-package – Chase Apr 21 '11 at 20:29
2

There's also a (not yet on CRAN) package that does some of the nitty gritty of parsing RSS feeds (and Atom) for you - nothing fancy, just some of the basic cleaning, normalization between the RSS and Atom spec, etc.

You can grab it from https://github.com/noahhl/r-does-rss

(full disclosure, I wrote it)

Noah
  • 2,574
  • 1
  • 18
  • 12
0

I wrote my own function to do this, using XML and xts. I posted it as a question on SO, because I think it could be improved.

Community
  • 1
  • 1
Zach
  • 29,791
  • 35
  • 142
  • 201