Googleブログ検索の検索結果をフィードとして読み込む
そんなことできたんだね。そして、Google AJAX Feed APIを利用すれば、フィードを表示させるのも超簡単実装!!Google便利!!これを使ってなにかできないかなぁ。考え中。
↓キーワード:cakePHP、更新日:1日以内で作ってみた。
<!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=キー"></script> <script type="text/javascript"> google.load("feeds", "1"); function initialize() { var feed = new google.feeds.Feed("フィードURL"); feed.setNumEntries(10); 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 li = document.createElement("li"); var a = document.createElement("a"); a.href = entry.link; a.appendChild(document.createTextNode(entry.title)); li.appendChild(a); container.appendChild(li); } } }); } google.setOnLoadCallback(initialize); </script> </head> <body> <h2>Google ブログ検索</h2> <p>検索キーワード:cakePHP</p> <p>更新日:1日以内</p> <ol id="feed"></ol> </body> </html>