Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Quick and dirty Google Feed API example, fetching the first image of each feed item.
<!doctype html>
<html lang="en">
<meta charset="utf-8" />
<title>Google Feed API JSONP Example displaying some Images -</title>
<script type="text/javascript">
function processResults (response) {
var entries = response.responseData.feed.entries;
var images = document.getElementById('images');
for (var i = entries.length - 1; i >= 0; i--) {
if (!entries[i].mediaGroups) {
var imageURL = entries[i].mediaGroups[0].contents[0].url;
var image = document.createElement('img');
image.src = imageURL;
function doRequest (src, callback) {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = src;
if (callback) {
script.onload = callback;
<div id="images"></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.