Rust library for Hatena API.
For the specifications of each API, refer to Hatena Developer Center.
status | API | note |
---|---|---|
☀️ | Hatena OAuth | OAuth v1.0a only, WSSE is not supported |
☁️ | Hatena Fotolife | post image |
⛈️ | Hatena Star | |
⛈️ | Hatena Blog | |
⛈️ | Mackerel | |
⛈️ | Hatena Bookmark |
/// OAuth
use hatena_rs::oauth::{HatenaOauth, HatenaConsumerInfo consts::OauthScope};
let scopes = vec![
OauthScope::WritePublic,
OauthScope::WritePrivate,
OauthScope::ReadPublic,
OauthScope::ReadPrivate,
];
let consumer_info = HatenaConsumerInfo::from_env()?;
let mut oauth = HatenaOauth::new(scopes, None, consumer_info)?;
let access_token = oauth.get_access_token(true)?;
/// Fotolife
use hatena_rs::fotolife::Fotolife;
let fotolife = Fotolife::new(oauth);
fotolife.post_image("./kirby.png", "title", 30)?;