pr0gramm-api-2
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

pr0gramm-api

A Node.js API for pr0gramm written in TypeScript.

npm install -S pr0gramm-api

Usage

import { Pr0grammAPI, ItemFlags } from "pr0gramm-api";

const api = Pr0grammAPI.createWithCookies();

async function main() {
    let mainItems = await api.items.getItems({
        promoted: true,
        flags: ItemFlags.All
    });
    console.dir(mainItems.items);

    let loginResponse = await api.user.login("cha0s", "stahl0fen80");
    if(!loginResponse.success) {
        console.log("Could not log in :(");
        if(loginResponse.ban !== null) {
            console.log("You are banned. Reason:");
            console.log(loginResponse.ban.reason);
            return;
        }
    }
}
main();

Readme

Keywords

Package Sidebar

Install

npm i pr0gramm-api-2

Weekly Downloads

0

Version

2.0.0

License

GPL-3.0

Last publish

Collaborators

  • picknicker95