crabrave
An ergonomic Rust client for the Tumblr API, inspired by Octocrab.
Features
- OAuth1 and OAuth2 authentication
- Type-safe builder patterns for all API operations
- NPF (Neue Post Format) support for modern posts
- Note that this project supports NPF only. Legacy posts will be returned in the trail content of
Poststructs
- Note that this project supports NPF only. Legacy posts will be returned in the trail content of
- Media uploads
- Runtime-agnostic async
- Comprehensive error handling with rate limit detection
Installation
[]
= "0.4"
Quick Start
use Crabrave;
async
OAuth2 Flow
use OAuth2Config;
// 1. Generate authorization URL
let config = new;
let = config.authorize_url;
// 2. Direct user to auth_url, receive code in callback
// 3. Exchange code for token
let token = config.exchange_code.await?;
// 4. Use token with client
let crab = builder
.consumer_key
.consumer_secret
.access_token
.build?;
Creating Posts
use ContentBlock;
use MediaSource;
// Text post
crab.blogs
.create_post
.add_block
.tags
.send
.await?;
// Post with image upload
crab.blogs
.create_post
.add_image
.send
.await?;
Error Handling
use CrabError;
match crab.blogs.info.await
API Coverage
| Module | Endpoints |
|---|---|
| Blogs | info, posts, avatar, followers, following, likes, blocks, drafts, queue, submissions, notifications, notes, pages |
| Users | info, dashboard, likes, following, follow/unfollow, like/unlike, filtered tags, filtered content |
| Posts | get, create, edit, delete, reblog, mute |
| Tagged | search posts by tag |
| Communities | info, timeline, join/leave, members, invitations, moderation, reactions |