64 releases

new 0.14.1 Nov 19, 2024
0.13.10 Nov 2, 2024
0.13.7 Jun 19, 2024
0.13.2 Mar 14, 2024
0.2.5 Nov 26, 2022

#19 in WebSocket

Download history 117/week @ 2024-08-01 37/week @ 2024-08-08 29/week @ 2024-08-15 24/week @ 2024-08-22 126/week @ 2024-08-29 111/week @ 2024-09-05 119/week @ 2024-09-12 200/week @ 2024-09-19 306/week @ 2024-09-26 73/week @ 2024-10-03 49/week @ 2024-10-10 101/week @ 2024-10-17 42/week @ 2024-10-24 172/week @ 2024-10-31 79/week @ 2024-11-07 269/week @ 2024-11-14

576 downloads per month
Used in 5 crates

MIT license

1MB
27K SLoC

Megalodon

Crates.io docs.rs Build GitHub

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

Supporting

  • Mastodon
  • Pleroma
  • Friendica
  • Firefish
  • Gotosocial
  • Akkoma (Unofficial)

Features

  • REST API
  • Admin API
  • WebSocket for Streamings

Usage

Add your Cargo.toml like this:

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

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.

Dependencies

~12–28MB
~440K SLoC