Created
May 5, 2015 19:05
-
-
Save talves/0bad702c5bbf2fa9af09 to your computer and use it in GitHub Desktop.
SlideShow SlideData fix
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: '' | |
}; | |
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