2 releases
0.1.1 | Jan 30, 2022 |
---|---|
0.1.0 | Jan 29, 2022 |
#15 in #google-drive
17KB
346 lines
Twitter send frame
A Twitter bot to send images from an AWS S3 bucket.
Requirements
Some env var are required
AWS_ACCESS_KEY
Required for working with AWS S3AWS_SECRET_KEY
Required for working with AWS S3TWITTER_SEND_FRAME_CONFIG_FILE
Absolute or relative config file path. See Config file section for more details.TWITTER_CONSUMER_KEY
The consumer key, required for posting on Twitter. Can also be an executable parameter.TWITTER_CONSUMER_SECRET
The consumer secret, required for posting on Twitter. Can also be an executable parameter.
Usage
twitter_send_frame 0.1.0
USAGE: twitter_send_frame --twitter-consumer-key --twitter-consumer-secret
FLAGS: -h, --help Prints help information -V, --version Prints version information
OPTIONS: --twitter-consumer-key [env: TWITTER_CONSUMER_KEY] --twitter-consumer-secret [env: TWITTER_CONSUMER_SECRET]
Config file
{
// Number of frame to post
"nb_to_post": 3,
// Resource directory. Used to store Twitter access token and keep trace of image index.
"resource_dir": "/home/dwittwer/projects/twitter_send_frame/res",
// Tmp dir to use to keep images from S3 before posting it. Tis directory is removed after each execution
"tmp_dir": "/tmp/twitter_send_frame",
"aws": {
// AWS bucket to use
"bucket": "my-bucket",
// AWS region to use
"region": "us-east-1",
// Endpoint to use if AWS like object storage [optional]
"endpoint": "https://my-custom.endpoint.cloud",
// object key prefix [optional]
"key_prefix": "frames/storage/",
// Object key template. {nb | nb_formatter} must be present and will be replaced with the current image number to post
"key_template": "FRAME{nb | nb_formatter}.jpg",
// Padding number for the key. For example if set to 4, current number to 42 with previous template the object key will be "FRAME0042.jpg"
"key_nb_padding": 4
},
"twitter": {
// The message of the tweet. {nb} must be present and will be replaced by the curren frame number
"message_template": "My awesome movie \n\nframe {nb} of 122894"
}
}
With Cargo (recommended)
Run cargo install twitter_send_frame
.
To specify log level, add RUST_LOG
env var.
From sources
Install the Rust toolchain https://www.rust-lang.org/tools/install
Download sources on Gitlab
Inside the downloaded project run cargo install --path .
to install the tool or cargo run
to run it.
Versioning
This project adheres to Semantic Versioning and use git flow branching model.
Copyright and Licence
Copyright 2022 David Wittwer and Contributors
This project is licensed under GNU GPLv3 license. See license file
Dependencies
~28–42MB
~753K SLoC