Question

In the Blekko search engine you can get the search results in JSON format, e.g. with the search term 'lifehacker':

http://blekko.com/ws/?q=lifehacker+%2Fjson

How could you carry out this query from R and parse the content? [There is a URL, a RSS URL and a snippet with the main text.]

I have tried packages tm.plugin.webmining and boilerpipeR, but couldn't figure it out.

Was it helpful?

Solution

Using Rcurl and RJSONIO packages is very handy to retrieve rjson results:

library(RCurl)
library(RJSONIO)
doc <-  getURL('http://blekko.com/ws/?q=lifehacker+%2Fjson')
doc.ll <- fromJSON(doc)

Then you can check the result like this :

doc.ll$RESULT
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top