second level search directory

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
php.newbie
Forum Newbie
Posts: 16
Joined: Wed Sep 20, 2006 3:28 am

second level search directory

Post 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
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post 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
php.newbie
Forum Newbie
Posts: 16
Joined: Wed Sep 20, 2006 3:28 am

Post by php.newbie »

Hi there,

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

Regards,
Richard
Post Reply