FLICKR_UPLOAD(1p)

πŸ“¦
version 1.60 Β· 2 versions
  • 1.60 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.60 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– FLICKR_UPLOAD(1p) πŸ’–

okay bestie, buckle up β€” this is flickr_upload, straight out of the User Contributed Perl Documentation section of the manual. she's a whole vibe and she uploads ur pics. let's go ✨


🌸 NAME 🌸

flickr_upload β€” upload photos to flickr.com. that's it. that's the job. she does it in batches and she does it beautifully. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

flickr_upload [--auth] --auth_token <auth_token> [--title <title>]
     [--description description] [--public <0|1>] [--friend <0|1>]
     [--family <0|1>] [--tag <tag>] [--option key=value] [--progress]
    <photos...>

πŸ‘‘ DESCRIPTION πŸ‘‘

Batch image uploader for the Flickr.com service. she takes ur photos, she sends them to the cloud, she comes back with URLs. iconic behavior fr fr 🌈

also!! flickr_upload may also be useful for generating authentication tokens against other API keys/secrets β€” like, if you wanna embed them in scripts? yeah. she's flexible like that. πŸŽ€


✨ OPTIONS ✨

  • --auth β€” this flag makes flickr_upload generate an authentication token against its API key and secret (or, if you're feeling fancy, your own specific key and secret). the catch: you need a browser handy so you can cut and paste a url. yes, cut and paste, we're living in the past a little, it's fine. 🫢 the resulting token should be stashed somewhere like ~/.flickrrc, because you literally need it to actually upload images. no token, no pics. periodt.
  • --auth_token <auth_token> β€” the authentication token. you must get one using --auth before you can upload images. no shortcuts bestie. see the EXAMPLES section below. πŸ“Ž
  • --oauth β€” interactively perform OAuth authorization with Flickr. the user gets a URL to visit at Flickr where Flickr::Upload must be granted write permissions. after granting permission, you'll get redirected to a dummy URL that contains an OAuth token and verifier. you paste that URL at the prompt, and flickr_upload saves the resulting credentials in ~/.flickroauth.st. slay. πŸ”
  • --title <title> β€” title to use on all the images. optional. ⭐
  • --description <description> β€” description to use on all the images. optional. πŸ“
  • --public <0|1> β€” override the default is_public access control. optional. πŸ‘€
  • --friend <0|1> β€” override the default is_friend access control. optional. πŸ«‚
  • --family <0|1> β€” override the default is_family access control. optional. 🏠
  • --tag <tag> β€” images get tagged with tag. you can hand over multiple --tag options, or just dump them all into a single space-separated list. if you want a tag with spaces in it, the quotes have to be part of the tag itself. this works in bash:
flickr_upload --tag='"tag one"' --tag='"tag two"' image.jpg

🏷️

  • --reverse β€” reverse the list of supplied images. super useful when uploading the contents of a directory with sorted filenames. the following example will upload the last glob-expanded file first and vice versa. so the last file appears first in your target photo stream. πŸ’«
flickr_upload --reverse *.jpg
  • --set <NAME> β€” after successfully uploading all photos, create a new set named NAME, and add the photos into the set. one (random) photo will be the set's thumbnail. random thumbnail? main character energy, honestly. πŸŽ€
  • --option key=value β€” Flickr periodically adds new features to the uploading API, and these are almost always implemented as new key/value pairs. instead of waiting around for a new Flickr::Upload release, you can specify any of the upload API's optional arguments using --option.
flick_upload --option content_type=1 --tag='cats' two_cats.jpg

you may also use --option instead of flickr_upload's command-line options:

flickr_upload --option is_public=1 --option title='cats' two_cats.jpg

while Flickr may add new options at any time (peep <https://www.flickr.com/services/api/upload.api.html> for the most up-to-date list), currently known options include:

  • --option safety_level=<1|2|3> β€” override the default safety_level notation. set to 1 for Safe, 2 for Moderate, or 3 for Restricted. refer to <https://www.flickr.com/help/filters/>. πŸ”ž
  • --option content_type=<1|2|3> β€” override the default content_type notation. set to 1 for Photo, 2 for Screenshot, or 3 for Art/Illustration. refer to <https://www.flickr.com/help/filters/>. πŸ–ΌοΈ
  • --option hidden=<1|2> β€” override the default hidden notation. set to 1 to keep the photo in global search results, 2 to hide from public earches. πŸ™ˆ
note that options unknown to Flickr will result in undefined behaviour. no cap. πŸ’€
  • --check β€” checks the authentication token via the flickr.auth.checkToken API call. this is how you verify API keys and credentials without trying to upload an image. the output is the raw results of the API call. raw and unfiltered, we love that. πŸ”
  • --progress, --no-progress β€” display a progress bar for each upload with Term::ProgressBar. that optional module will have to be installed on the system. the default is not to display a progress bar. you can change that in the configuration file:
echo progress=1 >~/.flickrrc

πŸ“Š

  • --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. the default is to display a report after each upload. you can change that in the configuration file:
echo report=0 >~/.flickrrc

πŸ—žοΈ

  • --key <api_key>
  • --secret <secret> β€” your own API key and secret. useful if you wanna use flickr_upload in auth mode as a token generator. you need both key and secret. both key and secret can be placed in ~/.flickrrc, which lets you mix flickr_upload with your own scripts using the same API key and authentication token. getting your own API key and secret is encouraged if you're tying flickr_upload to some automated process. πŸ”‘
heads up bestie: if you do get an authentication token against your own API key and secret, you'll need to specify the key and secret along with the token when uploading images. the default flickr_upload API key and token won't work in that case. 😭
  • <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 URL 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 known to occur. 😭 thirty. minutes. we wait. patiently. πŸ•°οΈ

🌈 EXAMPLES 🌈

first, you need to get an authentication token. this is a requirement driven by how Flickr manages third-party applications:

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>

unless you like typing long numbers on the command-line, you should keep the <token> somewhere handy, like a configuration file:

echo auth_token=<token> >~/.flickrrc

uploading a bunch of images is then as easy as:

flickr_upload --tag 'dog' 'kernel in a window.jpg' 'sad in sunbeam.jpg'

look at her go. 🐢πŸͺŸβ˜€οΈ


πŸŽ€ 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 $HOME/.flickrrc if it exists. any field defined there can, of course, be overridden on the command line. for example:

# my config at $HOME/.flickrrc
auth_token=334455
is_public=0
is_friend=1
is_family=1
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. pick a lane, bestie. πŸ™ˆ

πŸ’€ BUGS πŸ’€

error handling could be better. that's it. that's the bug report. she said it herself. 😭


🫢 AUTHORS 🫢

Christophe Beauregard, cpb@cpan.org.

Γ†var ArnfjΓΆrΓ° Bjarmason, <avar@cpan.org>.

legends, both of them. πŸ‘‘


πŸ”— SEE ALSO πŸ”—


and that's the whole page, bestie!! this lil beauty ships with perl v5.34.0 and she was last touched on 2022-06-14 β€” and honestly? she still ate. πŸ’…βœ¨ go forth and upload, you've got this. πŸ¦‹πŸŒΈπŸ’–

πŸ“¦ where this page comes from