|
| 1 | +# Rodeo: Flickr Uploader |
| 2 | + |
| 3 | +Rodeo uploads images to [Flickr][1], applying keyword based rules to add the image to albums and also to delete keywords that you may not want to be published. |
| 4 | + |
| 5 | +It can also resize images for sharing on social media or in messages. |
| 6 | + |
| 7 | +[1]: https://flickr.com |
| 8 | + |
| 9 | +## Usage |
| 10 | + |
| 11 | +### rodeo upload |
| 12 | + |
| 13 | +Upload files to Flickr, applying rules to either delete keywords or add to an album. |
| 14 | + |
| 15 | +``` |
| 16 | +rodeo upload <files...> |
| 17 | +``` |
| 18 | + |
| 19 | + |
| 20 | +### rodeo resize |
| 21 | + |
| 22 | +Resize image within a bounding box at a given quality which can be useful for social media or messaging. |
| 23 | + |
| 24 | +``` |
| 25 | +rodeo resize <files...> |
| 26 | +``` |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | +### rodeo info |
| 31 | + |
| 32 | +Displays useful metadata information about the files. |
| 33 | + |
| 34 | +``` |
| 35 | +$ rodeo info <files...> |
| 36 | +``` |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | +### Other commands |
| 42 | + |
| 43 | +| Command | Purpose | |
| 44 | +| --- | --- | |
| 45 | +| `rodeo viewconfig` | Display Rodeo's configuration. | |
| 46 | +| `rodeo authenticate` | Authenticate with Flickr. | |
| 47 | +| `rodeo listalbums` | List albums (helpful to find album IDs. | |
| 48 | + |
| 49 | + |
| 50 | +## Installation |
| 51 | + |
| 52 | +1. Clone this repository |
| 53 | +2. Build rodeo: `go build` |
| 54 | +3. Copy to a directory on your path: `mv rodeo /usr/local/bin` |
| 55 | +4. Run `rodeo --help` to check that it works |
| 56 | + |
| 57 | +### Install dependencies |
| 58 | + |
| 59 | +Rodeo requires a Flickr API key. To get this: |
| 60 | + |
| 61 | +1. Go to [https://www.flickr.com/services/apps/create/apply][https://www.flickr.com/services/apps/create/apply] |
| 62 | +2. Click "Apply for a Non-Commercial Key" |
| 63 | +3. Enter these details: |
| 64 | + * Name: *Rodeo for {your name here}* |
| 65 | + * What are you building: *Command line Flickr uploader* |
| 66 | + * Check both check boxes if you acknowledge and agree to them |
| 67 | +4. Press Submit |
| 68 | +5. The *Key* and *Secret* are now displayed. Write these down. |
| 69 | +6. Run `rodeo authenticate` to add your *Key* and *Secret* and to then authenticate with Flickr so that Rodeo has |
| 70 | + access to your photos. |
| 71 | + |
| 72 | +### Command line tools |
| 73 | + |
| 74 | +Install [`exiftool`][2] and [`convert`][3] as Rodeo requires them. |
| 75 | + |
| 76 | +On macOS, these can be installed using [`brew`][4]. On Linux, use your distro's package manager. |
| 77 | + |
| 78 | +[2]: https://exiftool.org |
| 79 | +[3]: https://imagemagick.org/script/convert.php |
| 80 | +[4]: https://brew.sh |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + ## Config |
| 85 | + |
| 86 | + Rodeo's configuration is stored in `~/.config/rodeo.yaml` |
| 87 | + |
| 88 | + Example: |
| 89 | + |
| 90 | + ```yaml |
| 91 | + # location of command line tools |
| 92 | +cmd: |
| 93 | + convert: /usr/local/bin/convert |
| 94 | + exiftool: /usr/local/bin/exiftool |
| 95 | + |
| 96 | +# Flickr configuration - use `rodeo authenticate` to set |
| 97 | +flickr: |
| 98 | + api_key: "{api key}" |
| 99 | + api_secret: "{api secret}" |
| 100 | + full_name: "{full name}" |
| 101 | + oauth_token: "{auth token}" |
| 102 | + oauth_token_secret: "{auth token secret}" |
| 103 | + user_nsid: "{user's id}" |
| 104 | + username: "{user's name}" |
| 105 | + |
| 106 | +# Configuration for `rodeo resize` |
| 107 | +resize: |
| 108 | + method: "catrom" |
| 109 | + quality: "75" |
| 110 | + scale: "2000x2000" |
| 111 | + |
| 112 | +# rules for `rodeo upload` |
| 113 | +keywords: |
| 114 | + {keyword}: |
| 115 | + delete: true |
| 116 | + album_id: "{album id}" |
| 117 | +``` |
| 118 | +
|
| 119 | +### Resize configuration |
| 120 | +
|
| 121 | +If these do not exist in `rodeo.yaml`, then they are added automatically on first |
| 122 | +run of `rodeo resize` |
| 123 | + |
| 124 | +| Property | What it does | |
| 125 | +| --------- | ----------------------------------------------------------------------- | |
| 126 | +| `method` | [Interpolation method][im]. Default is `catrom` | |
| 127 | +| `quality` | [JPEG/PNG compression level][cl] of resized image in %. Default is `75` | |
| 128 | +| `scale` | Bounding dimensions of resized image in px. Default is `2000x2000` | |
| 129 | + |
| 130 | +[im]: https://imagemagick.org/script/command-line-options.php#interpolate |
| 131 | +[cl]: https://imagemagick.org/script/command-line-options.php#quality |
| 132 | + |
| 133 | +### Upload rules |
| 134 | + |
| 135 | +For each keyword there are two actions: |
| 136 | + |
| 137 | +| Action | What it does | |
| 138 | +| ---------- | ------------------------------------------------------------------------------------ | |
| 139 | +| `delete` | When `true`, deletes the keyword from the file so that it does not exist on Flickr. | |
| 140 | +| `album_id` | Flickr ID of the album that this image will be added to. | |
| 141 | + |
| 142 | + |
0 commit comments