Integrate Google search results in iframe possible?

Mark
Mark used Ask the Experts™
on
I want to display search results from google automatically using fixed keywords like phone numbers/email in a small widget box/iframe

Basically I have a table with phone numbers being displayed in HTML and in one of the columns--I would like more information on that phone number displayed from Google search results without clicking a link
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
<!DOCTYPE html>
<head>
<title>Demo</title>
<link href="css/new_style.css" rel="stylesheet" type="text/css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.js" type="text/javascript"></script>
<script type="text/javascript">

$(document).ready(function(){
 var q = '605-475-6962';
 results=5;
 if(location.search) q=unescape(location.search);
 $.getScript('https://ajax.googleapis.com/ajax/services/search/web?callback=processResults&rsz='+results+'&v=1.0&q='+escape(q));
});

function processResults(data){
 $.each(data.responseData.results, function (i, data) {
  $('#gResults').append('<a href="'+ data.url +'" target="_blank">'+ data.titleNoFormatting +'<a><br />' + data.content + '<hr />');
 });
}
</script>
</head>
<body>

<h1>Results</h1>

605-475-6962

<div id="gResults"></div>

</body>
</html>

Open in new window

MarkProgrammer

Author

Commented:
Perfect, thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial