Skip to content

Instantly share code, notes, and snippets.

@heldrida
Created September 16, 2014 22:06
Show Gist options
  • Save heldrida/fa7b98c7e58300415646 to your computer and use it in GitHub Desktop.
Save heldrida/fa7b98c7e58300415646 to your computer and use it in GitHub Desktop.
Famo.us lesson 101 (Starter kit), picasa album link is invalid! Here's a solution
define(function(require, exports, module) {
var SlideData = {
picasaUrl: 'https://picasaweb.google.com/data/feed/api/all',
queryParams: '?kind=photo&q=puppy&max-results=5&imgmax=720&alt=json',
defaultImage: 'https://lh4.googleusercontent.com/-HbYp2q1BZfQ/U3LXxmWoy7I/AAAAAAAAAJk/VqI5bGooDaA/s1178-no/1.jpg'
};
SlideData.getUrl = function() {
return SlideData.picasaUrl + SlideData.queryParams;
};
SlideData.parse = function(data) {
var urls = [];
data = JSON.parse(data);
var entries = data.feed.entry;
for (var i = 0; i < entries.length; i++) {
var media = entries[i].media$group;
urls.push(media.media$content[0].url);
}
return urls;
};
module.exports = SlideData;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment