I am creating a web application using Google AJAX Feed API to display 5 latest blog titles from a website.
The code which i am using is following -(The key which i used in this is for directory " localhost/rss/ ")
Code: Select all
<form action="" method="get">
How many feeds you want to show ??
<br />
<input type="text" name="x"value="" size="1" maxlength="2">
<br />
<input type="submit" value="submit">
</form>
<?php
$x=$_GET['x'];
?>
<html>
<head>
<script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAv5uCBbSj0o9kkU3g2mXJThROC4bvNdgYBpkrp5Ijzw2YwsWbFxScFdgIEHgetqZJBTE81deWlOy71Q"></script>
<script type="text/javascript">
google.load("feeds", "1");
var defaultQuery = 'Webyog';
function findFeeds(query) {
google.feeds.findFeeds(query, feedSearchDone);
}
function feedSearchDone(result) {
var el = document.getElementById('feedControl');
if (result.error || result.entries.length <= 0) {
el.innerHTML = 'No Results Found';
return;
}
// Create a feed control
var feedControl = new google.feeds.FeedControl();
// Grab top 4..
for (var i = 0; i < <?php echo $x ;?> ; i++) {
feedControl.addFeed(result.entries[i].url, result.entries[i].title);
}
feedControl.setLinkTarget(google.feeds.LINK_TARGET_BLANK);
feedControl.setNumEntries(1);
feedControl.draw(el);
}
google.setOnLoadCallback(function() {findFeeds(defaultQuery)});
</script>
</head>
<body>
<div id="feedControl">Loading</div>
</body>
</html>But the thing is i want that application should update the list of blogs asynchronously at every user-specified interval of time.I am not getting any idea about this ...any suggetion will be wonderful ???
regards
amit