flickr.upload: Upload a photo to Flickr account

Description Usage Arguments Value Author(s) References See Also Examples

Description

This function provides the mechanism to upload an image to a flickr account, assuming that we have the relevant write privileges. One can specify a title, description, and control who can view the photo and the safety_level.

Usage

1
2
3
4
5
6
flickr.upload(secret, auth_token, api_key, image,
               title = NA, description = NA,
                is_family = NA, is_friend = NA, is_public = NA,
                 safety_level = NA, tags = character(), ...,
                  .opts = list(), curl = getCurlHandle(),
                   .url = "http://api.flickr.com/services/upload/")

Arguments

secret

The secret for the API

auth_token

the authentication token obtained by the user granting access to the Flickr account via authenticate.

api_key

the key for the application making the request

image

the name of the file containing the image, or a character or raw vector giving the contents of the image

title

an optional title for the image to be displayed in Flickr

description

an optional description for the image to be displayed in Flickr

is_family

a logical value controlling whether the image can be viewed by family

is_friend

a logical value controlling whether the image can be viewed by friends

is_public

a logical value controlling whether the image can be viewed by everyone

safety_level

an integer/logical value controlling whether the image is safe for general viewing

tags

a character vector of tags to associate with the image

...

additional parameters that are passed on in the Flickr request

.opts

a list of CURL options

curl

a curl handle that can be reused across HTTP requests

.url

the URL of the REST services. This is rarely specified by the caller.

Value

The string id of the new photo.

Author(s)

Duncan Temple Lang

References

Flickr API, specifically http://www.flickr.com/services/api/upload.api.html.

See Also

authenticate

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 
    # we would need the secret, token and api_key

 f = tempfile()
 png(f)
 plot(1:10)
 dev.off()

 o = flickr.upload(secret, token, api_key,
                   f, # the name of the file containing the picture
                   title = "A sample plot from R",
                   description = "Created in R via plot(1:10)",
                   content_type = "1",
                   is_family = "0",
                   is_friend = "0",
                   is_public = "0",
                   safety_level = "1",
                   tags = 'other',
                   .opts = list(verbose = TRUE, followlocation = TRUE))

## End(Not run)

duncantl/Rflickr documentation built on May 15, 2019, 5:54 p.m.