Code Monkey home page Code Monkey logo

megalodon-rs's Introduction

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 Licnese 2.0.

megalodon-rs's People

Contributors

dependabot[bot] avatar esttorhe avatar h3poteto avatar hylobates-agilis avatar lunasorcery avatar matthiasbeyer avatar ndarilek avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.