Solved

Display google results in my website

Posted on 2008-06-17
6
573 Views
Last Modified: 2013-12-08
I want to dislay the google results in my website.  
I am running PHP and want to dynamically display the google search engine results in my webpage.
The google results I assume will be displayed in a frame on my webpage.

For example, I have the query http://news.google.com/news?hl=en&ned=us&q=aflcio and I want the resulting data displayed on my website.
0
Comment
Question by:pmsguy
6 Comments
 
LVL 20

Assisted Solution

by:virmaior
virmaior earned 150 total points
ID: 21806041
meaning you want to display that page in a iframe or you want to curl the data into your own web page?
0
 

Author Comment

by:pmsguy
ID: 21806711
Whatever is the most optimal solution.
0
 
LVL 20

Expert Comment

by:virmaior
ID: 21806748
in this case, the choice isn't about optimization.  They are substantially different ways of doing this with significant trade-offs.

For an IFRAME, it's going to be obvious that you are just putting google in an IFRAME.  and you won't be able to control anything about it.

For curl, google probably won't appreciate it.

a third option is that google has a search API that you can use, but I believe they charge to use it for any commercial purpose.

0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 18

Assisted Solution

by:Matthew Kelly
Matthew Kelly earned 150 total points
ID: 21807806
I have used this script before:

http://www.digitalpoint.com/tools/search/

It is well documented, simple, and lets you put google results in your own website, formatted the way you want. Try it out!
0
 
LVL 18

Expert Comment

by:Matthew Kelly
ID: 21807809
0
 
LVL 31

Accepted Solution

by:
gwkg earned 200 total points
ID: 21809279
Simply grab an RSS feed of your search

http://news.google.com/news?q=aflcio&output=rss

Google RSS Feed info: http://www.google.com/support/news/bin/answer.py?hl=en&answer=59255

Search Google for RSS PHP if you need more info on how to display the XML data in PHP.  There are a lot of libraries out there.

Here is one way to do it. http://www.ibm.com/developerworks/xml/library/x-phprss/index.html
And another: http://rssphp.net/
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question