npm

Share private packages across your team with npm Orgs, now with simplified billing via the aws marketplace!Learn more »

pr0gramm-api-2

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();

Keywords

install

npm i pr0gramm-api-2

Downloadsweekly downloads

3

version

2.0.0

license

GPL-3.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability