Crystal library and CLI tool for Catbox.moe
名称 | 大小 | Rev. | 时间 | 作者 | Log Message |
---|---|---|---|---|---|
.hgignore | 35 | 79c7ed16a744 | 2023-03-31 17:51:29 | Remilia Scarlet <remilia@posteo.jp> | Ignore shard.lock |
LICENSE | 33.71 k | 164612b11309 | 2021-08-27 19:30:38 | Remilia Scarlet <remilia@posteo.jp> | Initial import |
README.md | 4.47 k | 7b5ffbb18c61 | 2023-04-20 16:36:25 | Remilia Scarlet <remilia@posteo.jp> | Update README |
shard.yml | 299 | 3c5ff3d4a8cb | 2023-03-30 23:53:39 | Remilia Scarlet <remilia@posteo.jp> | Update to a newer libremiliacr versio... |
src | 3c5ff3d4a8cb | 2023-03-30 23:53:39 | Remilia Scarlet <remilia@posteo.jp> | Update to a newer libremiliacr versio... | |
tools | 3c5ff3d4a8cb | 2023-03-30 23:53:39 | Remilia Scarlet <remilia@posteo.jp> | Update to a newer libremiliacr versio... |
RemiCatbox is a simple API for the Catbox API. It also
includes catboxtool
, a command line program to access Catbox.
Wanna support Remilia? Buy me a coffee on Ko-Fi, or support me through Liberapay.
You will need Mercurial installed to clone this repository.
You will need Fossil installed to clone some of the dependencies for this repository. You will also need Shards v0.17.1 or later. If you have an earlier version of Shards, you will need to to build the latest version manually.
If you just want to build the command line program, clone this repository
locally, then run shards build
(or shards build --release
for a release
build). The binary will be in the bin/
directory.
To use this as a library, clone this repository somewhere on your local machine, then look at Library Usage below.
dependencies:
remicatbox:
hg: http://hg.pf.osdn.net/view/y/yu/yukiraven/remicatbox
The command line client will upload files/URLs unless you tell it otherwise. To upload local files, call it like this (it will print the URL of the new file if the upload was successful):
catboxtool /path/to/file.png /path/to/other-file.jpg"
You can also specify URLs, or mix and match:
catboxtool /path/to/other-file.jpg http://www.example.com/some-image.png"
To delete a file on Catbox, use --delete
and list out the Catbox filenames you
wish to delete.
New albums can be created by specifying --album-title
together with a set of
files/URLs. The album will be called whatever you pass to --album-title
.
CatboxTool will report the Catbox URLs for the new files, as well as the URL for
the new album.
Album management can be done with the --album
option. This takes the short
code of the album, which is the last part of an album's URL (for example, the
short code for https://catbox.moe/c/a91gkg
is a91gkg
).
Use this for a full list of options:
catboxtool --help
On Linux, the configuration file is located in the XDG config directory (usually
~/.config/
). On Windows, it is in the %APPDATA%\catboxtool
directory. In
both of these cases, the file is named catboxtool.json
. On Macs, it's located
in the home directory as a hidden file called .catboxtool.json
.
If a user hash is specified in the configuration file, then it is used for all interactions by default. This can be disabled with the --no-user-hash options.
If no configuration file exists, a new one will be created (without a user hash) when this is first run.
I use a somewhat non-standard style for my code.
puts
, pp
, p
, raise
, sleep
, spawn
, loop
, and exit
.do |foo|...end
syntax with blocks, except when it's all on
one line, then always use { and }.ExternalProgramError
.RemiCatbox and catboxtool are under the GNU Affero General Public License version 3.