14 releases (breaking)

Uses old Rust 2015

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

#302 in Template engine

Download history 44/week @ 2024-07-28 35/week @ 2024-09-22 6/week @ 2024-09-29

63 downloads per month

MIT license

120KB
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

~12–21MB
~414K SLoC