Description Usage Arguments Value Author(s) References See Also Examples
This function and the associated class and methods
provide a mechanism for invoking Flickr API operations
more conveniently from R than the regular
flickr.*
functions in this package.
Using this function flickrSession
,
we create a FlickrSession
object having
received an auth_token
via authenticate
(and previously having registered an application with
Flickr and obtaining an api_key
and secret).
The \$
method for this object uses
matching to allow users refer to Flickr API
functions using shorter names, e.g. getHotList
rather than flickr.tags.getHotList.
Also, it inserts the api_key
, auth_token
and secret
into each call, removing the need to explicitly
specify them in calls to the top-level
flickr.*
functions in this package.
This is both more convenient and also
makes the R commands/scripts more secure
by not having private information visible
in the calls. The FlickrSession
object can be created once outside of the
script.
1 | flickrSession(secret, auth_token, api_key)
|
api_key |
a string. See the documentation in Rflickr.xml in the doc/ directory for how to register an application and
create an |
auth_token |
the string returned from a call to |
secret |
a string that comes with the creation of an application. |
An object of class FlickrSession
.
This has a $
method for easy invocation of Flickr operations.
Duncan Temple Lang
http://www.flickr.com/services/api
flickrSession
All of the flickr.*
functions.
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
hot = flickr.tags.getHotList(secret, token, api_key)
s = flickrSession(secret, authenticate(api_key, secret), api_key)
s$getHotList()
now = Sys.time()
dates = paste(as.integer(c(now - 21*60*60*24, now)), collapse = ",")
s$getCounts(dates)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.