samedi 14 février 2015

Google Feed API - returning media:thumbnail


I'm currently using the Google Feed API and attempting to retrieve a thumbnail from an RSS feed ("media:thumbnail")


The media:thumbnail line in the RSS feed looks like this:



<media:thumbnail url="http://ift.tt/1A2oCNm" width="150" height="150"/>


Note: The thumbnail is not part of a media:group


The script looks like this:



google.load("feeds", "1");

function initialize() {
var feed = new google.feeds.Feed("http://ift.tt/1zlDqj9");
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));
div.appendChild(document.createTextNode(entry.link));
container.appendChild(div);
}
}
});
}
google.setOnLoadCallback(initialize);

</script>


The TITLE and the LINK are returning just fine. But I don't see anything in the Feed API docs about returning media:thumbnail -- or specifically it's URL.


Anyone know how I might return the thumbnail URL using the feed API?





Aucun commentaire:

Enregistrer un commentaire