Code Monkey home page Code Monkey logo

pastebin's Introduction

pastebin

A pure Dart Pastebin API Wrapper.

Features

This package covers every endpoint disclosed in Pastebin API documentation (as of 16 May, 2022). The following table links the endpoints to the respective package functions:

API Endpoints Function Description
/api/api_post.php (2-8) paste(pasteText, options) Publishes a paste (with support for optional parameters) in Pastebin.
/api/api_login.php (9) apiUserKey(username, password) Retrieves and refreshes user API key (not developer key).
/api/api_post.php (10) pastes(userKey, limit=50) Fetches an user pastes, with support for limiting how many pastes are returned.
/api/api_post.php (11) delete(pasteKey, userKey) Deletes an user paste.
/api/api_post.php (12) userInfo(userKey) Obtains user information and settings.
/api/api_raw.php (13) rawPaste(pasteKey, visibility, userKey) Gets the raw paste (full text) of a user paste.
/api/raw.php (14) rawPaste(pasteKey, visibility) Gets the raw paste (full text) of paste.

There is also support for multiple API key ingestion, a neat feature for making sure that pastes are published, even if you are rate limited by Pastebin.

// Using Official Pastebin API with a single API Dev Key
var pastebinClient = withSingleApiDevKey(
    apiDevKey: primaryApiDevKey,
);

// Using Official Pastebin API with multiple API Dev Key
pastebinClient = withMultipleApiDevKey(
    apiDevKeys: [
        primaryApiDevKey,
        fallbackApiDevKey1,
        fallbackApiDevKey2,
        ...
        fallbackApiDevKeyN,
    ],
);

Side Effects

Powered by Dart null sound + dartz monads, this package is free of null issues and side effects. This is to prevent the throw of any exception that may not be known and caught by developers, and to make sure that information is consistent by contract.

Every HTTP request returns an Either monad that either returns the response result on the right hand, or ResponseError instance on the left hand that is typed to each possible Pastebin error (see available errors here).

Why use pastebin.dart?

The main use case that inspired the development of this package, is to provide developers (mostly indie) a way to publish and read app logs for free.


Bugs and Contributions

Found any bug (including typos) in the package? Do you have any suggestion or feature to include for future releases? Please create an issue via GitHub in order to track each contribution. Also, pull requests are very welcome!

Disclaimer

This is not an official library/SDK implemented by the Pastebin team, but rather a developer implementation that uses it.

pastebin's People

Contributors

freitzzz avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

saiive nexyd

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.