Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (30 sloc) 1.26 KB
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google AJAX Feed API - Simple Example</title>
<script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAA3IVJC0cZ1C2LAPOfUsrBOBTsfzl1QwKR8hH4jo0KILRKyy1CGRQy2bi5TWVVpkSURszMn4xkmOxHDg"></script>
<script type="text/javascript">
google.load("feeds", "1");
function getAdsense() {
var feed = new google.feeds.Feed("http://adwordsapi.blogspot.com/atom.xml?length=200");
feed.setNumEntries(20);
feed.load(function(result) {
if (!result.error) {
var container = document.getElementById("feed");
for (var i = 0; i < result.feed.entries.length; i++) {
var entry = result.feed.entries[i];
var div = document.createElement("div");
div.appendChild(document.createTextNode(entry.title));
container.appendChild(div);
}
}
});
}
</script>
</head>
<body>
<input type="button" value="get Adsense" onClick="javascript:getAdsense()">
<div id="feed"></div>
</body>
</html>