curl-and-php
Re: Searching google result
Date: Tue, 18 Sep 2007 14:42:29 +0900
Hi
curl_setopt($ch, CURLOPT_URL,
'
http://www.google.com/search?hl=en&q='.urlencode($keyword).'&btnG=Google+Search&meta='
);
---->
'
http://www.google.com/search?hl=en&num=5&q='.urlencode($keyword).'&btnG=Google+Search&meta='
);
It is ok.
wangyong
2007/9/18, jigen <i_love_jigen_at_yahoo.com>:
>
> i have here a function(easy function) that search
> google for a certain keyword using curl library what i
> want is i want to return the top 5 url of the search
> result thats what i dont know how to do it
> anyone??thanks
>
>
> function curl_google($keyword){
>
> $ch = curl_init();
> curl_setopt($ch, CURLOPT_URL,
> '
> http://www.google.com/search?hl=en&q='.urlencode($keyword).'&btnG=Google+Search&meta='
> );
> curl_setopt($ch, CURLOPT_HEADER, 1);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
> curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
> curl_setopt($ch, CURLOPT_FILETIME, true);
> $data = curl_exec($ch);
> curl_close($ch);
>
> }
>
>
>
>
>
>
>
>
> ____________________________________________________________________________________
> Yahoo! oneSearch: Finally, mobile search
> that gives answers, not web links.
> http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2007-09-18