Skip to content

Instantly share code, notes, and snippets.

@davetayls
Created November 7, 2011 12:50
Show Gist options
  • Select an option

  • Save davetayls/1344846 to your computer and use it in GitHub Desktop.

Select an option

Save davetayls/1344846 to your computer and use it in GitHub Desktop.
Flickr AMD Module
/*
* Flickr AMD Module
*/
/*jslint browser: true, vars: true, white: true, forin: true, indent: 4 */
/*global define,require */
define(
['jquery'],
function($){
'use strict';
var API = 'http://api.flickr.com/services/feeds'
;
return {
loadUserPhotos: function(userId, callback) {
$.getJSON(API + '/photos_public.gne?id=' + userId + '&format=json&jsoncallback=?', function(data, status){
callback.apply(this, arguments);
});
},
loadGroupPhotos: function(groupId, callback) {
$.getJSON(API + '/groups_pool.gne?id=' + groupId + '&format=json&jsoncallback=?', function(data, status){
callback.apply(this, arguments);
});
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment