1FLICKR_UPLOAD(1) User Contributed Perl Documentation FLICKR_UPLOAD(1)
2
3
4
6 flickr_upload - Upload photos to "flickr.com"
7
9 flickr_upload [--auth] --auth_token <auth_token> [--title <title>]
10 [--description description] [--public <0|1>] [--friend <0|1>]
11 [--family <0|1>] [--tag <tag>] [--option key=value] [--progress]
12 <photos...>
13
15 Batch image uploader for the Flickr.com service.
16
17 flickr_upload may also be useful for generating authentication tokens
18 against other API keys/secrets (i.e. for embedding in scripts).
19
21 --auth
22 The "--auth" flag will cause flickr_upload to generate an
23 authentication token against it's API key and secret (or, if you
24 want, your own specific key and secret). This process requires the
25 caller to have a browser handy so they can cut and paste a url. The
26 resulting token should be kept somewhere like "~/.flickrrc" since
27 it's necessary for actually uploading images.
28
29 --auth_token <auth_token>
30 Authentication token. You must get an authentication token using
31 "--auth" before you can upload images. See the EXAMPLES section.
32
33 --title <title>
34 Title to use on all the images. Optional.
35
36 --description <description>
37 Description to use on all the images. Optional.
38
39 --public <0|1>
40 Override the default "is_public" access control. Optional.
41
42 --friend <0|1>
43 Override the default "is_friend" access control. Optional.
44
45 --family <0|1>
46 Override the default "is_family" access control. Optional.
47
48 --tag <tag>
49 Images are tagged with "tag". Multiple "--tag" options can be
50 given, or you can just put them all into a single space-separated
51 list. If you want to define a tag with spaces, the quotes have to
52 be part of the tag itself. The following works in bash:
53
54 flickr_upload --tag='"tag one"' --tag='"tag two"' image.jpg
55
56 --option key=value
57 Flickr periodically adds new features to the uploading API, and
58 these are almost always implemented as new key/value pairs. Rather
59 than waiting for a new Flickr::Upload release, you can specify any
60 of the upload API's optional arguments using "--option".
61
62 flick_upload --option content_type=1 --tag='cats' two_cats.jpg
63
64 You may also use "--option" rather than flickr_upload's command-
65 line options:
66
67 flickr_upload --option is_public=1 --option title='cats' two_cats.jpg
68
69 While Flickr may add new options at any time (see
70 <http://flickr.com/services/api/upload.api.html> for the most up-
71 to-date list), currently known options include:
72
73 --option safety_level=<1|2|3>
74 Override the default "safety_level" notation. Set to 1 for
75 Safe, 2 for Moderate, or 3 for Restricted. Refer to
76 <http://www.flickr.com/help/filters/>.
77
78 --option content_type=<1|2|3>
79 Override the default "content_type" notation. Set to 1 for
80 Photo, 2 for Screenshot, or 3 for Art/Illustration. Refer to
81 <http://www.flickr.com/help/filters/>.
82
83 --option hidden=<1|2>
84 Override the default "hidden" notation. Set to 1 to keep the
85 photo in global search results, 2 to hide from public earches.
86
87 --check
88 Checks the authentication token via the flickr.auth.checkToken
89 API call. This can be used to verify API keys and credentials
90 without trying to upload an image. The output is the raw
91 results of the API call.
92
93 --progress
94 Display a progress bar for each upload with Term::ProgressBar.
95 That optional module will have to be installed on the system.
96
97 Note that options unknown to Flickr will result in undefined
98 behaviour.
99
100 --key <api_key>
101 --secret <secret>
102 Your own API key and secret. This is useful if you want to use
103 flickr_upload in auth mode as a token generator. You need both
104 "key" and "secret". Both "key" and "secret" can be placed in
105 "~/.flickrrc", allowing to mix flickr_upload with your own scripts
106 using the same API key and authentication token. Getting your own
107 API key and secret is encouraged if you're tying flickr_upload to
108 some automated process.
109
110 Note that if you do get an authentication token against your own
111 API key and secret, you'll need to specify the key and secret along
112 with the token when uploading images. The default flickr_upload API
113 key and token won't work in that case.
114
115 <photos...>
116 List of photos to upload. Uploading stops as soon as a failure is
117 detected during the upload. The script exit code will indicate the
118 number of images on the command line that were not uploaded. For
119 each uploaded image, a Flickr URL will be generated. flickr_upload
120 uses asynchronous uploading so while the image is usually
121 transferred fairly quickly, it might take a while before it's
122 actually available to users. flickr_upload will wait around for
123 that to complete, but be aware that delays of upwards of thirty
124 minutes have (rarely) been know to occur.
125
127 First, you need to get an authentication token. This is a requirement
128 driven by how Flickr manages third-party applications:
129
130 cpb@earth:~$ flickr_upload --auth
131 1. Enter the following URL into your browser
132
133 http://flickr.com/services/auth?api_sig=<...>&frob=<...>&perms=write&api_key=<...>
134
135 2. Follow the instructions on the web page
136 3. Hit <Enter> when finished.
137 Your authentication token for this application is
138 <token>
139
140 Unless you like typing long numbers on the command-line, you should
141 keep the "<token"> somewhere handy, like a configuration file:
142
143 echo auth_token=<token> >~/.flickrrc
144
145 Uploading a bunch of images is then as easy as:
146
147 flickr_upload --tag 'dog' 'kernel in a window.jpg' 'sad in sunbeam.jpg'
148
150 To avoid having to remember authentication tokens and such (or have
151 them show up in the process table listings), default values will be
152 read from "$HOME/.flickrrc" if it exists. Any field defined there can,
153 of course, be overridden on the command line. For example:
154
155 # my config at $HOME/.flickrrc
156 auth_token=334455
157 is_public=0
158 is_friend=1
159 is_family=1
160
161 Note, however, that these defaults override the defaults you've
162 assigned in your Flickr profile. You may want to do all that stuff in
163 one place.
164
166 Error handling could be better.
167
169 Christophe Beauregard, cpb@cpan.org.
170
172 flickr.com
173
174 Flickr::Upload
175
176 <http://flickr.com/services/api/>
177
178 <http://www.flickr.com/help/filters/>
179
181 Hey! The above document had some coding errors, which are explained
182 below:
183
184 Around line 371:
185 =back doesn't take any parameters, but you said =back 4
186
187 Around line 402:
188 You forgot a '=back' before '=head1'
189
190
191
192perl v5.12.0 2008-09-18 FLICKR_UPLOAD(1)