Senior & Expert RoR Developers Discussion Forum by Nyros Technologies

HIRE Ruby on Rails Expert Developers Programmers Coders From India
Ruby on Rails PHP .Net Developers Community, Nyros Technologies, Kakinada
 
Log in  or IF not a member please REGISTER
Username:
Password:   


Keyword
Log in | Profile 

Working with Google News API

 
Post new topic   Reply to topic    Senior & Expert RoR Developers Discussion Forum by Nyros Technologies Index -> API
View previous topic :: View next topic  
Author Message
kittu



Joined: 05 Sep 2008
Posts: 26

PostPosted: Wed Apr 01, 2009 6:46 am    Post subject: Working with Google News API Reply with quote

<html>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>

<script>

google.load("prototype", "1.6.0.3");
google.load("search", "1");
var searcher;

function processSearchResults()
{
var results = searcher.results;
for (var i=0; i<results.length; i++)
{
var divnode =new Element('div');
var subdiv =new Element('div');
divnode.appendChild(subdiv);
var dt = new Date(unescape(results[i].publishedDate));
subdiv.appendChild(new Element('div', { 'style':'float:left;padding-right:5px;'}).update(dt.getMonth() + "/" + dt.getDate() + "/" + dt.getYear()));
subdiv.appendChild(new Element('a', { href: unescape(results[i].url) }).update( unescape(results[i].titleNoFormatting)));
subdiv.appendChild(new Element('br'));

//divnode.appendChild(new Element('p', { 'class': 'news_result_detail'}).update(unescape(results[i].content)));
$('results_div').appendChild(divnode);
}
}

function doSearch()
{
searcher = new google.search.NewsSearch();
searcher.setSearchCompleteCallback(null,processSearchResults);
searcher.execute("\"sun microsystems\" [layoff OR \"plant closure\" OR merger OR divestiture OR \"profit warning\" OR restructuring OR \"corporate relocation\" OR upgrade OR downgrade]");
searcher.execute("\"boulder, co\" [zoning OR \"real *\" OR \"home prices\" OR foreclosures OR \"city council\" OR \"home sales\"]");
}

</script>



<body onLoad="doSearch()">

<h1>News Search</h1>

<div id="results_div"></div>

</body>
</html>
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Senior & Expert RoR Developers Discussion Forum by Nyros Technologies Index -> API
Page 1 of 1

 latest topics 
 Topics   Replies   Author   Views   Last Post 
No new posts Chat utility in a ROR application
0 shobana 2 Thu Sep 09, 2010 9:45 am
shobana View latest post
No new posts How to customize Google Maps InfoWindow using ym4r_gm
0 kalyanallampalli 54 Thu Sep 02, 2010 5:34 pm
kalyanallampalli View latest post
No new posts Drag and Drop file upload
0 umamageshwari 51 Wed Sep 01, 2010 9:36 am
umamageshwari View latest post
No new posts Flex On Rails
0 Raghu 48 Wed Sep 01, 2010 3:00 am
Raghu View latest post
No new posts MongoDB
0 Raghu 45 Tue Aug 31, 2010 3:30 pm
Raghu View latest post
No new posts Problem with Dreamweaver / java error
3 Raja 37 Tue Aug 31, 2010 3:24 pm
Raghu View latest post
No new posts Generating Model
0 phani.galla 44 Tue Aug 31, 2010 2:09 pm
phani.galla View latest post
No new posts Hide Panels using JQuery
0 Anu 48 Tue Aug 31, 2010 1:50 pm
Anu View latest post
No new posts Load a text file using ajax in jquery
0 Anu 38 Tue Aug 31, 2010 1:39 pm
Anu View latest post
No new posts Generating Migrations
0 phani.galla 31 Tue Aug 31, 2010 1:38 pm
phani.galla View latest post




Hire an expert Ruby on Rails developer / coder / programmer or development team from India now!!

Other Forums : PHP   ::   .Net   |   Free unlimited HTML CSS templates download

Nyros Technologies   |   Kakinada City Portal   |   Developers Blog   |   About Ruby on Rails Experts   |   More