Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/h3poteto/megalodon-rs
Fediverse API client library for Rust
https://github.com/h3poteto/megalodon-rs
friendica mastodon pleroma rust
Last synced: 1 day ago
JSON representation
Fediverse API client library for Rust
- Host: GitHub
- URL: https://github.com/h3poteto/megalodon-rs
- Owner: h3poteto
- License: apache-2.0
- Created: 2022-08-28T01:52:00.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-10-24T23:22:14.000Z (about 2 months ago)
- Last Synced: 2024-10-29T17:34:31.511Z (about 2 months ago)
- Topics: friendica, mastodon, pleroma, rust
- Language: Rust
- Homepage:
- Size: 1.19 MB
- Stars: 111
- Watchers: 2
- Forks: 23
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
Awesome Lists containing this project
README
# Megalodon
[![Crates.io](https://img.shields.io/crates/v/megalodon)](https://crates.io/crates/megalodon)
[![docs.rs](https://img.shields.io/docsrs/megalodon/latest)](https://docs.rs/megalodon/latest/megalodon/)
[![Build](https://github.com/h3poteto/megalodon-rs/actions/workflows/build.yml/badge.svg)](https://github.com/h3poteto/megalodon-rs/actions/workflows/build.yml)
[![GitHub](https://img.shields.io/github/license/h3poteto/megalodon-rs)](LICENSE.txt)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](https://github.com/h3poteto/megalodon).## Supporting
- [x] Mastodon
- [x] Pleroma
- [x] Friendica
- [x] Firefish
- [x] Gotosocial
- [x] Akkoma (Unofficial)
- [x] Sharkey (Unofficial)
- [x] Hometown (Unofficial)
- [x] Iceshrimp (Unofficial)## Features
- [x] REST API
- [ ] Admin API
- [x] WebSocket for Streamings## Usage
Add your `Cargo.toml` like this:```
[dependencies]
megalodon = { version = "0.11" }
```### Making Mastodon request
For a request without authentication.```rust
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.```rust
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](https://www.apache.org/licenses/LICENSE-2.0).