「網戸+自作+DIY などで検索してる方へ」 |
「押入れ改造の記録」 |
「踏み台を諦めてベビーゲート作りに着手」 |
KRLGHDN: かてごり: DIY |
// ①(head内に記述)
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">google.load("feeds", "1");
function initialize() {
var feed = new google.feeds.Feed("http://pinterest.com/aintai/my-dining/rss");
feed.load(function(rss) {
if (!rss.error) {
var channel = new Array();
var entry = new Array();
channel['title'] = rss.feed.title;
channel['link'] = rss.feed.link;
channel['favicon'] = "http://favicon.hatena.ne.jp/?url=" + channel['link'];
channel['description'] = rss.feed.description;
channel['author'] = rss.feed.author;
for (var i=0; i<rss.feed.entries.length; i++){
entry[i] = {
title : rss.feed.entries[i].title,
link : rss.feed.entries[i].link,
content : rss.feed.entries[i].content,
};<
entry[i]['img'] = rss.feed.entries[i].content.match(/src=\"(.*?)\"/igm);
for (var j=0; j<entry[i]['img'].length; j++){
entry[i]['img'][j] = entry[i]['img'][j].replace(/src=/ig, "");
entry[i]['img'][j] = entry[i]['img'][j].replace(/\"/ig, "");
}
}
var Feed = '<img class="fav" src="' + channel['favicon'] + '">\n'
+ '<a href="' + channel['link'] + '">' + channel['title'] + ': </a>\n'
+ '<a href="'+ entry[0]['link'] + '">' + entry[0]['title'] + ' ...</a>\n'
+ '<img width="200" src="' + entry[0]['img'][0] + '">'
+ '<img class="fav" src="' + channel['favicon'] + '">\n'
+ '<a href="' + channel['link'] + '">' + channel['title'] + ': </a>\n'
+ '<a href="'+ entry[1]['link'] + '">' + entry[1]['title'] + ' ...</a>\n'
+ '<img width="200" src="' + entry[1]['img'][0] + '">'
+ '<img class="fav" src="' + channel['favicon'] + '">\n'
+ '<a href="' + channel['link'] + '">' + channel['title'] + ': </a>n'
+ '<a href="'+ entry[2]['link'] + '">' + entry[2]['title'] + ' ...</a>\n'
+ '<img width="200" src="' + entry[2]['img'][0] + '">'
$('#topics').append( Feed );
}
});
}
google.setOnLoadCallback(initialize);</script>
//② body内に記述
<div id="topics"></div>