あれこれ備忘録@はてなブログ

勉強したことやニュースや出来事を備忘録として書いていきます

このブログには広告が含まれます

APIを使わずにTumblrのRSSを表示する

APIを使わずにTumblrRSSを表示するJavascript

今回使ったのは大英博物館が公開している資料のTumblr

大英博物館が無料公開した100万点以上の歴史的資料を効率よく見る方法 - GIGAZINE

自分でRSSのブログバーツを作っているようで楽しい。

RSS feed widget free from FeedWind, the best RSS widget available

<script type="text/javascript" charset="utf-8" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<script>
function loadRSS() {
    $.ajax({
        url: 'http://query.yahooapis.com/v1/public/yql?q=' + 'SELECT%20description%20FROM%20rss%20WHERE%20url="http://mechanicalcurator.tumblr.com/rss"',
        type: "GET",
        dataType: "text"
    }).done(function(data) {
            $(data).find("description").each(function(i, element) {
                $("#photo").append($(element).text());
            });
    });
}
</script>
<input type="button" onclick="loadRSS()" value="load" />
<div id="photo"></div>