#twitter #api #api-wrapper #tweet #client #macro #tweetust

yanked tweetust_macros

Macros used in tweetust

Uses old Rust 2015

0.0.2 Jan 31, 2015
0.0.1 Jan 18, 2015

#27 in #tweet

29 downloads per month

MIT license

11KB
253 lines

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:

client!

client!(
    StatusesClient,
    [ // APIs
        (
            show, // method name,
            Get, // HTTP method
            "https://api.twitter.com/1.1/statuses/show/{}.json",
            // required parameters
            [id: String, ...],
            // optional parameters
            [trim_user: bool, ...],
            Status // return type
        ),
        ...
    ]
);

If the API endpoint has "{}", inserts the first argument there.

#paramenum! Make Pascal Case enum members and implement fmt::String.

paramenum!(EnumName { a, b, c });

#[id_eq] Implement PartialEq and Eq by comparing the IDs.

No runtime deps