Skip to content

Mastodon and Pleroma API client library for Rust

License

Notifications You must be signed in to change notification settings

VyrCossont/megalodon-rs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Megalodon

Crates.io docs.rs Build GitHub

The megalodon is a client library for Mastodon and Pleroma. It provides REST API and streaming method which uses WebSocket. By using this library, you can take Mastodon and Pleroma with the same interface. This library is Rust version of megalodon.

Features

  • REST API
    • Mastodon
    • Pleroma
  • Streaming with WebSocket
    • Mastodon
    • Pleroma
  • Proxy support

Usage

Add your Cargo.toml like this:

[dependencies]
megalodon = { version = "0.1" }

Making Mastodon request

For a request without authentication.

let client = megalodon::generator(
  megalodon::SNS::Mastodon,
  String::from("https://fedibird.com"),
  None,
  None,
);
let res = client.get_instance().await?;
println!("{:#?}", res.json());

Making Mastodon request with authentication

For a request with authentication.

let client = megalodon::generator(
  megalodon::SNS::Mastodon,
  String::from("https://fedibird.com"),
  Some(String::from("your access token")),
  None,
);
let res = client.verify_account_credentials().await?;
println!("{:#?}", res.json());

License

The software is available as open source under the terms of the Apache License 2.0.

About

Mastodon and Pleroma API client library for Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%