School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!
You're Browsing As A Guest! Register Now...
Become an Expert!

Join 353,769 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,870 people online right now.Registration is fast and FREE... Join Now!



Displaying search results from multiple websites

Displaying search results from multiple websites Rate Topic: -----

#1 Xioshin  Icon User is offline

  • D.I.C Head
  • PipPip

Reputation: 0
  • View blog
  • Posts: 232
  • Joined: 05-November 08


Dream Kudos: 0

Posted 02 July 2009 - 01:46 PM

Hi,

I believe it would be possible to display on my own custom page the search results of other websites. For example, if I type in "apples" on a form on my own website, it would put "apples" into both Google.com and Yahoo.com and then list a number of returned results (we'll say 10 for simplicity's sake).

How exactly would I go about this?

I figured I would have to take the query string from the form and add that to the appropriate URL depending on how each particular website does it, such as http://www.google.co...#hl=en&q=apples.

I would then take this longer URL and what I assumed would be using cURL to get the HTML response of the search and then use regular expressions to pull the data between certain tags (that would also vary depending on which site we were currently getting the results from).


Is this correct? Should I not be using cURL?

Is it even legal to have a website which will pull a response and display it on your own website without their permissions?

This post has been edited by Xioshin: 02 July 2009 - 01:47 PM

Was This Post Helpful? 0
  • +
  • -


#2 ShaneK  Icon User is offline

  • require_once("brain.php"); //Fatal error :/
  • Icon

Reputation: 53
  • View blog
  • Posts: 745
  • Joined: 10-May 09


Dream Kudos: 125

Expert In: PHP, MySQL

Re: Displaying search results from multiple websites

Posted 02 July 2009 - 02:54 PM

That sounds about right. You can also use file_get_contents(), but it's up to you :P (Also note, no matter your choice, you'll wanna use urlencode.)

Not sure about the legality of taking other sites' contents. I doubt Google would have a problem with it, but who knows? You should probably try locating their terms of service and seeing if they say anything about it. If you can't find anything there, you might wanna try contacting them or something....assuming you wanna be on the absolute safe side.

Yours,
Shane~

This post has been edited by ShaneK: 02 July 2009 - 02:55 PM

Was This Post Helpful? 0
  • +
  • -

#3 Xioshin  Icon User is offline

  • D.I.C Head
  • PipPip

Reputation: 0
  • View blog
  • Posts: 232
  • Joined: 05-November 08


Dream Kudos: 0

Re: Displaying search results from multiple websites

Posted 02 July 2009 - 03:15 PM

Ah file_get_contents.. i was trying to remember the name of the function but was having trouble.

Thanks for your reply. Hopefully people can add more.
Was This Post Helpful? 0
  • +
  • -



Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month