twitter_send_frame

Crates.iotwitter_send_frame
lib.rstwitter_send_frame
version0.1.1
sourcesrc
created_at2022-01-29 20:59:44.725455
updated_at2022-01-30 10:32:00.424948
descriptionTwitter bot to send images from a google drive.
homepage
repositoryhttps://gitlab.com/t00l5/twitter_send_frame
max_upload_size
id523789
size61,456
David Wittwer (Dawen18)

documentation

README

Twitter send frame

dependency status pipeline status

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 S3
  • AWS_SECRET_KEY Required for working with AWS S3
  • TWITTER_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

Commit count: 11

cargo fmt