Java Mailing List Archive

http://www.r-help.com/

Home » R Help for Statistical Computing »

Re: [R] R program google search

Duncan Temple Lang

2010-09-04

Replies: Find Java Web Hosting

Author LoginPost Reply
Hi there

One way to use Google's search service from R is

libary(RCurl)
library(RJSONIO) # or library(rjson)

val = getForm("http://ajax.googleapis.com/ajax/services/search/web", q = "Google search AJAX ", v = "1.0")
results = fromJSONIO(val)

Google requests that you provide your GoogleAPI key

val = getForm("http://ajax.googleapis.com/ajax/services/search/web", q = "Google search AJAX ", v = "1.0",
           k= "my google api key")

Similarly, you should provide header information to identify your application, e.g

xx = getForm("http://ajax.googleapis.com/ajax/services/search/web", q = "Google search AJAX ", v = "1.0",
          .opts = list(useragen = "RGoogleSearch", verbose = TRUE))




D.

On 9/3/10 10:33 PM, Waverley @ Palo Alto wrote:
> My question is how to use R to program google search.
> I found this information:
> "The SOAP Search API was created for developers and researchers
> interested in using Google Search as a resource in their
> applications." Unfortunately google no longer supports that. They
> are supporting the AJAX Search API. What about R?
>
> Thanks.
>
>
>
> On Fri, Sep 3, 2010 at 2:23 PM, Waverley @ Palo Alto
> <waverley.paloalto@(protected):
>> Hi,
>>
>> Can someone help as how to use R to program google search in the R
>> code? I know that other languages can allow or have the google search
>> API
>>
>> If someone can give me some links or sample code I would greatly appreciate.
>>
>> Thanks.
>>
>> --
>> Waverley @ Palo Alto
>>
>
>
>

______________________________________________
R-help@(protected)
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
©2008 r-help.com - Jax Systems, LLC, U.S.A.