FlickrUploader, v2.0.14

Provides an interface to the Flickr Authorization and Upload API.

NOTE: FlickrUploader depends on RubyInterpreter.

Other Versions

2.0.14, 2.0.13, 2.0.11, 2.0.10

BrowserPlus.FlickrUploader.check_auth({params}, function{}())

Checks to see if the user has authorized to Flickr. The results contains a map with (authorized, nsid, username, fullname) if 'authorized' is true. Otherwise, the results map contains (authorized, auth_url, frob) if 'authorized'is false. When 'authorized' is false, open a new browser window setting the location set to 'auth_url' so the user can authorize uploads to Flickr. Once that is done, call 'get_auth_token' with 'frob'.

Test: check_auth()

Parameters

verify_auth: boolean (Optional)
If verify_auth is "true", verify that the user is still authorized by making a webservice call to Flickr. Otherwise, just check locally.

BrowserPlus.FlickrUploader.get_auth_token({params}, function{}())

Gets and stores the authorization token from Flickr.

Test: get_auth_token()

Parameters

frob: string
The frob returned from check_auth

BrowserPlus.FlickrUploader.signout({params}, function{}())

Remove authentication information from this service.

Test: signout()

Parameters

nsid: string
The Flickr NSID of the user to remove.

BrowserPlus.FlickrUploader.get_photo_info({params}, function{}())

Gets information about where the photo is stored. Returns map of {id, farm, server, secret}.

Test: get_photo_info()

Parameters

photo_id: string
The ID of the photo to query.

BrowserPlus.FlickrUploader.get_people_info({params}, function{}())

Gets information about a Flickr user. Returns map of {ispro, iconfarm, iconserver}.

Test: get_people_info()

Parameters

nsid: string
The Flickr NSID of the user to query.

BrowserPlus.FlickrUploader.get_photosets({params}, function{}())

Return all of the current user's photo sets. Return a list of maps [{id: 1, title: 'My Great Photos'}]

Test: get_photosets()

Parameters

No Parameters

BrowserPlus.FlickrUploader.upload({params}, function{}())

Upload one or more local photos to a Flickr using POST. The return value is map of lists {'files', 'errors'}. Each entry in the list is: [string file] - the uploaded filename [string userdata] - the userdata string [string response] - contains photoid for 'files' and the error message for 'errors'.

Test: upload()

Parameters

callback: callback
Javascript progress callback which is passed a object with the following keys: (file, userdata, pc, pos, size)
files: list
List of maps: {file, filename, userdata, postvars}. File is a BrowserPlus file handle (obtained via Drag and Drop or the FileBrowser dialog). Filename is the name to be used for the uploaded file. Userdata is an optional string passed back to every callback to relate file back to DOM id or what not. Postvars is an map of additional optional photo attributes that include {title, description, tags, is_public, is_friend, is_family, safety_level, content_type, hidden}.