調べる機会があったのと、これ見てjQuery勉強するためにメモ。
<html> <head> <title>test</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> $.getJSON("http://twitter.com/statuses/user_timeline/Ricckn.json?callback=?", function(data) { $("#LastTweet").html(data[0].text); }); </script> <!-- Riccknの部分を任意のユーザー名に --> </head> <body> <div id="LastTweet"></div> </body> </html>
超簡易だけど、これ使ったらいろいろ面白いこと出来るかもね。
サンプル:http://remicck.net/getUserTimeline.html
まるまる参考にしたのはこちら:Twitterの最新ツイートを、jQuery と PHP で取得する2つの方法