Page 1 of 1

second level search directory

Posted: Mon Dec 18, 2006 3:23 am
by php.newbie
Dear All,

I noticed in centain websites, they pull some search engine result and display on their own website. e.g

http://magix-search.com/search/movies/web/1

Any idea how did they do it? is it possible to do it using PHP?

Thanks in advance

Posted: Mon Dec 18, 2006 3:39 am
by Kieran Huggins
You could use file_get_contents() to "get" a page from a search engine, then parse out the resuts:

Code: Select all

$google_search = file_get_contents('http://www.google.com/search?q=buffy+the+vampire+slayer');
At this point I'd try importing the source into a DOM tree and transforming it with XSLT.

Cheers,
Kieran

Posted: Mon Dec 18, 2006 8:29 pm
by php.newbie
Hi there,

thanks for quick reply. i will try it out and update soon.

Regards,
Richard