/example-rust-twitter

Writing a example of Rust program.

Primary LanguageRust

Twitter CLI Client Example in Rust

This is a example of Twitter CLI client written in Rust.

This is the first project I wrote in Rust. I found it difficult to learn Rust and it took me a while to make this program. However, Rust is a very nice and beautiful programming language.

If you are a Rust beginner and refer to my code, I'll be very happy.

Usage

This small client has only two functions. Show timeline and tweet comment. You can use following commands.

0. Prepare

# resolve dependencies and build
cargo build

Save a configuration file on your home directory.

~/.twclirc.yaml

CONSUMER_KEY: aaa
CONSUMER_SECRET: bbb
ACCESS_TOKEN: ccc
ACCESS_TOKEN_SECRET: ddd

1. Show home timeline

# show 10 tweets of your timeline in your commandline.
cargo run timeline 10

2. Tweet your text

# tweet your text on Twitter.
cargo run tweet "test tweet. remove this later."

Dependencies

I used four libralies. They helped me a lot to get my program finished faster. And I realized that Rust's standard library has a few network library?

oauth-client = "0.3"
serde_json = "1.0.16"
config = "0.8"
clap = "~2.31"

Reference

Thank you for your source code. I frequently refered to this reposiory.
gifnksm/twitter-api-rs