Jump to content

Batch search from list of keywords?


psunshine

Recommended Posts

Hi,

 

This may seem like something simple to do for some but I for the life of me cannot get my head around it!

 

Basically I want to be able to enter a list of keywords and retrieve the top 3 urls (from google for example) for each keyword seperately. Is this something that can be acheived with curl and php or something similar? If anyone has any ideas or direction it would be much appreciated.

 

Thanks

P

Link to comment
https://forums.phpfreaks.com/topic/117781-batch-search-from-list-of-keywords/
Share on other sites

Well I don't know much about cURL. But let's get this straight.

You want people to be able to enter some keywords on your site. Those keywords are sent to googles search via cURL then the first 3 results on the page are displayed to the user on your website?

 

Correct?

It doesnt have to be curl, preferably whatever would be the best solution, im flexible.

 

I want it to do the search for each keyword/keywords seperately and then the top x amount of results for each are displayed. So example input would be:

 

football david beckham

cricket

hockey

 

Results like this:

 

football david beckham - en.wikipedia.org/wiki/David_Beckham , www.thefa.com/England/SeniorTeam

cricket                      - en.wikipedia.org/wiki/Cricket , www.thecricket.nu

hockey                      - www.nhl.com/ , en.wikipedia.org/wiki/Ice_hockey

 

So you basically end up with a new line seperated batch google search with comma seperated results (or similar!).

 

 

google URLs are like this:

 

google.com/search?q=keywords

 

All you need to do is file_get_contents(that_url) and use regular expressions to parse out the data.

 

----------------

Now playing: Dance Gavin Dance - It's Safe to Say You Dig the Backseat

via FoxyTunes

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.