14 releases (breaking)

0.10.0 Jun 6, 2019
0.9.0 Jun 22, 2018
0.8.0 Jun 22, 2017
0.5.0 Feb 6, 2017
0.0.2 Jan 31, 2015

#10 in #twitter

Download history 50/week @ 2019-11-02 8/week @ 2019-11-09 41/week @ 2019-11-16 44/week @ 2019-11-23 72/week @ 2019-12-07 2/week @ 2019-12-14 15/week @ 2019-12-28 5/week @ 2020-01-04 16/week @ 2020-01-11 25/week @ 2020-01-18 17/week @ 2020-01-25 2/week @ 2020-02-01 22/week @ 2020-02-08

123 downloads per month
Used in twitter-stream

MIT license

115KB
3K SLoC

tweetust

crates.io Build Status

Twitter API wrapper for Rust.

Roadmap

  • Parse Tweet.source (in serde_json?)
  • media API
    • media/metadata/create
  • collections API
  • Streaming
  • jsonmap element in API definition files
    • direct_messages/events
  • Support hyper 0.11 (I wonder it is very hard...)

How to build

This project generates code using the CoreTweet API Templates. CoreTweet is included as a submodule so:

git clone --recursive git@github.com:azyobuzin/tweetust.git

...before cargo build.


lib.rs:

Tweetust is a simple wrapper for Twitter API.

Getting started

This is a Twitter API wrapper, so you must lean Twitter API. Visit the official document.

After getting the API key, let's start using tweetust.

How to get the access token

See oauth::request_token function. After getting the access token, you can use to_authenticator function to make OAuthAuthenticator.

How to create OAuthAuthenticator with an access token string

See OAuthAuthenticator::new.

The first tweeting

When you created OAuthAuthenticator and set to auth variable, you can tweet in a minute.

use tweetust::*;

let handler = DefaultHttpHandler::with_https_connector().unwrap();
let auth = OAuthAuthenticator::new("API Key", "API Secret", "Access Token", "Access Token Secret");

let your_tweet =
  TwitterClient::new(auth, handler)
    .statuses()
    .update("My First Tweet!")
    .execute();

It's easy for those who have leaned about Twitter, isn't it?

Dependencies

~12MB
~322K SLoC