Created
September 16, 2014 22:06
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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