문제

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.

도움이 되었습니까?

해결책

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top