Jump to content

Getting the top 5 url in google search using CUrl library


jigen7

Recommended Posts

i have here a function that search google using curl library what i want is i want to return the top 5 url that what i dont knwo ho to do it anyone??thx

 

 

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);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.