Uses old Rust 2015
0.0.2 |
|
---|---|
0.0.1 |
|
#23 in #tweet
11KB
253 lines
tweetust
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.