.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "FLICKR_UPLOAD 1p" .TH FLICKR_UPLOAD 1p "2022-06-14" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" flickr_upload \- Upload photos to "flickr.com" .SH "SYNOPSIS" .IX Header "SYNOPSIS" flickr_upload [\-\-auth] \-\-auth_token [\-\-title ] [\-\-description description] [\-\-public <0|1>] [\-\-friend <0|1>] [\-\-family <0|1>] [\-\-tag <tag>] [\-\-option key=value] [\-\-progress] <photos...> .SH "DESCRIPTION" .IX Header "DESCRIPTION" Batch image uploader for the Flickr.com service. .PP flickr_upload may also be useful for generating authentication tokens against other \s-1API\s0 keys/secrets (i.e. for embedding in scripts). .SH "OPTIONS" .IX Header "OPTIONS" .IP "\-\-auth" 4 .IX Item "--auth" The \f(CW\*(C`\-\-auth\*(C'\fR flag will cause flickr_upload to generate an authentication token against it's \s-1API\s0 key and secret (or, if you want, your own specific key and secret). This process requires the caller to have a browser handy so they can cut and paste a url. The resulting token should be kept somewhere like \f(CW\*(C`~/.flickrrc\*(C'\fR since it's necessary for actually uploading images. .IP "\-\-auth_token <auth_token>" 4 .IX Item "--auth_token <auth_token>" Authentication token. You \fBmust\fR get an authentication token using \&\f(CW\*(C`\-\-auth\*(C'\fR before you can upload images. See the \s-1EXAMPLES\s0 section. .IP "\-\-oauth" 4 .IX Item "--oauth" Interactively perform OAuth authorization with Flickr. The user will get a \s-1URL\s0 to visit at Flickr at which Flickr::Upload must be granted write permissions. After granting permission, the user will be redirected to a dummy \s-1URL\s0 that contains an OAuth token and verifier. This user will paste this \s-1URL\s0 at the prompt, and flickr_upload will save the resulting credentials in \f(CW\*(C`~/.flickroauth.st\*(C'\fR. .IP "\-\-title <title>" 4 .IX Item "--title <title>" Title to use on all the images. Optional. .IP "\-\-description <description>" 4 .IX Item "--description <description>" Description to use on all the images. Optional. .IP "\-\-public <0|1>" 4 .IX Item "--public <0|1>" Override the default \f(CW\*(C`is_public\*(C'\fR access control. Optional. .IP "\-\-friend <0|1>" 4 .IX Item "--friend <0|1>" Override the default \f(CW\*(C`is_friend\*(C'\fR access control. Optional. .IP "\-\-family <0|1>" 4 .IX Item "--family <0|1>" Override the default \f(CW\*(C`is_family\*(C'\fR access control. Optional. .IP "\-\-tag <tag>" 4 .IX Item "--tag <tag>" Images are tagged with \f(CW\*(C`tag\*(C'\fR. Multiple \f(CW\*(C`\-\-tag\*(C'\fR options can be given, or you can just put them all into a single space-separated list. If you want to define a tag with spaces, the quotes have to be part of the tag itself. The following works in bash: .Sp .Vb 1 \& flickr_upload \-\-tag=\*(Aq"tag one"\*(Aq \-\-tag=\*(Aq"tag two"\*(Aq image.jpg .Ve .IP "\-\-reverse" 4 .IX Item "--reverse" Reverse the list of supplied images. Useful when uploading contents of directory with sorted filenames. Following example will upload the last glob expanded file as first and vice versa. The last file will appear first in target photo stream. .Sp .Vb 1 \& flickr_upload \-\-reverse *.jpg .Ve .IP "\-\-set <\s-1NAME\s0>" 4 .IX Item "--set <NAME>" After successfully uploading all photos, create a new set named \*(L"\s-1NAME\*(R",\s0 and add the photos into the set. One (random) photo will be the set's thumbnail. .IP "\-\-option key=value" 4 .IX Item "--option key=value" Flickr periodically adds new features to the uploading \s-1API,\s0 and these are almost always implemented as new key/value pairs. Rather than waiting for a new Flickr::Upload release, you can specify any of the upload \&\s-1API\s0's optional arguments using \f(CW\*(C`\-\-option\*(C'\fR. .Sp .Vb 1 \& flick_upload \-\-option content_type=1 \-\-tag=\*(Aqcats\*(Aq two_cats.jpg .Ve .Sp You may also use \f(CW\*(C`\-\-option\*(C'\fR rather than flickr_upload's command-line options: .Sp .Vb 1 \& flickr_upload \-\-option is_public=1 \-\-option title=\*(Aqcats\*(Aq two_cats.jpg .Ve .Sp While Flickr may add new options at any time (see <https://www.flickr.com/services/api/upload.api.html> for the most up-to-date list), currently known options include: .RS 4 .IP "\-\-option safety_level=<1|2|3>" 4 .IX Item "--option safety_level=<1|2|3>" Override the default \f(CW\*(C`safety_level\*(C'\fR notation. Set to 1 for Safe, 2 for Moderate, or 3 for Restricted. Refer to <https://www.flickr.com/help/filters/>. .IP "\-\-option content_type=<1|2|3>" 4 .IX Item "--option content_type=<1|2|3>" Override the default \f(CW\*(C`content_type\*(C'\fR notation. Set to 1 for Photo, 2 for Screenshot, or 3 for Art/Illustration. Refer to <https://www.flickr.com/help/filters/>. .IP "\-\-option hidden=<1|2>" 4 .IX Item "--option hidden=<1|2>" Override the default \f(CW\*(C`hidden\*(C'\fR notation. Set to 1 to keep the photo in global search results, 2 to hide from public earches. .RE .RS 4 .Sp Note that options unknown to Flickr will result in undefined behaviour. .RE .IP "\-\-check" 4 .IX Item "--check" Checks the authentication token via the flickr.auth.checkToken \s-1API\s0 call. This can be used to verify \s-1API\s0 keys and credentials without trying to upload an image. The output is the raw results of the \s-1API\s0 call. .IP "\-\-progress, \-\-no\-progress" 4 .IX Item "--progress, --no-progress" Display a progress bar for each upload with Term::ProgressBar. That optional module will have to be installed on the system. .Sp The default is not to display a progress bar. That can be changed in the configuration file: .Sp .Vb 1 \& echo progress=1 >~/.flickrrc .Ve .IP "\-\-report, \-\-no\-report" 4 .IX Item "--report, --no-report" Report the status of each upload ticket after uploading the batch via Flickr::Upload's check_upload method. On by default. Checking the status can be canceled by pressing ctrl-C. .Sp The default is to display a report after each upload. That can be changed in the configuration file: .Sp .Vb 1 \& echo report=0 >~/.flickrrc .Ve .IP "\-\-key <api_key>" 4 .IX Item "--key <api_key>" .PD 0 .IP "\-\-secret <secret>" 4 .IX Item "--secret <secret>" .PD Your own \s-1API\s0 key and secret. This is useful if you want to use flickr_upload in auth mode as a token generator. You need both \f(CW\*(C`key\*(C'\fR and \f(CW\*(C`secret\*(C'\fR. Both \f(CW\*(C`key\*(C'\fR and \f(CW\*(C`secret\*(C'\fR can be placed in \f(CW\*(C`~/.flickrrc\*(C'\fR, allowing to mix flickr_upload with your own scripts using the same \&\s-1API\s0 key and authentication token. Getting your own \s-1API\s0 key and secret is encouraged if you're tying flickr_upload to some automated process. .Sp Note that if you do get an authentication token against your own \s-1API\s0 key and secret, you'll need to specify the key and secret along with the token when uploading images. The default flickr_upload \s-1API\s0 key and token won't work in that case. .IP "<photos...>" 4 .IX Item "<photos...>" List of photos to upload. Uploading stops as soon as a failure is detected during the upload. The script exit code will indicate the number of images on the command line that were not uploaded. For each uploaded image, a Flickr \s-1URL\s0 will be generated. flickr_upload uses asynchronous uploading so while the image is usually transferred fairly quickly, it might take a while before it's actually available to users. flickr_upload will wait around for that to complete, but be aware that delays of upwards of thirty minutes have (rarely) been know to occur. .SH "EXAMPLES" .IX Header "EXAMPLES" First, you need to get an authentication token. This is a requirement driven by how Flickr manages third-party applications: .PP .Vb 2 \& cpb@earth:~$ flickr_upload \-\-auth \& 1. Enter the following URL into your browser \& \& https://www.flickr.com/services/auth?api_sig=<...>&frob=<...>&perms=write&api_key=<...> \& \& 2. Follow the instructions on the web page \& 3. Hit <Enter> when finished. \& Your authentication token for this application is \& <token> .Ve .PP Unless you like typing long numbers on the command-line, you should keep the \f(CW\*(C`<token\*(C'\fR> somewhere handy, like a configuration file: .PP .Vb 1 \& echo auth_token=<token> >~/.flickrrc .Ve .PP Uploading a bunch of images is then as easy as: .PP .Vb 1 \& flickr_upload \-\-tag \*(Aqdog\*(Aq \*(Aqkernel in a window.jpg\*(Aq \*(Aqsad in sunbeam.jpg\*(Aq .Ve .SH "CONFIGURATION" .IX Header "CONFIGURATION" To avoid having to remember authentication tokens and such (or have them show up in the process table listings), default values will be read from \&\f(CW\*(C`$HOME/.flickrrc\*(C'\fR if it exists. Any field defined there can, of course, be overridden on the command line. For example: .PP .Vb 5 \& # my config at $HOME/.flickrrc \& auth_token=334455 \& is_public=0 \& is_friend=1 \& is_family=1 .Ve .PP Note, however, that these defaults override the defaults you've assigned in your Flickr profile. You may want to do all that stuff in one place. .SH "BUGS" .IX Header "BUGS" Error handling could be better. .SH "AUTHORS" .IX Header "AUTHORS" Christophe Beauregard, cpb@cpan.org. .PP Ævar Arnfjörð Bjarmason, <avar@cpan.org>. .SH "SEE ALSO" .IX Header "SEE ALSO" flickr.com .PP Flickr::Upload .PP <https://www.flickr.com/services/api/> .PP <https://www.flickr.com/help/filters/>