Narrowly Preventing Mayhem

    node-utopian-rocks

    0.0.2 • Public • Published

    node-utopian-rocks

    GitHub license GitHub license

    An API wrapper for utopian.rocks.

    Installing

    Using npm:

    npm install node-utopian-rocks

    Usage

    First add it to your project

    // Using CommonJS modules
    const utopian = require('node-utopian-rocks');

    For example retrieving posts by category and status Asynchronously:

    await utopian.getPosts('development', 'reviewed')

    or by using .then() method:

    utopian.getPosts('development', 'reviewed').then(posts => posts);

    Or Let's run some tests:

    npm test
    

    API

    Request method aliases

    utopian.getPosts(params)

    utopian.getModerators()

    utopian.getStats(params)

    Request parameters

    These are the available parameters for making requests.

    We will start with posts object:

    utopian.getPosts(category, status, author, moderator, staff_picks)

    Any parameter can be ignored by empty string or just null

    utopian.getPosts(category, null, author, null, staff_picks)

    For moderators object it should be called without any parameters.

    utopian.getModerators();

    For Statistics

    /**
     * you can use a specificDate like 2018-05-24 or today, weekly.
     * Those are the available sections for stats:
     * moderators, categories, projects, staff_picks, task_requests
     * any thing else will retrieve all sections.
     */
    utopian.getStats(specificDate, section);

    Roadmap

    • Adding any upcoming API calls that will be available on https://utopian.rocks
    • More improvements and more advanced options, configs.

    Contributing

    Feel free to create any pull requests.

    Bugs

    If there is any bug please report it by opening a new issue.

    Install

    npm i node-utopian-rocks@0.0.2

    Version

    0.0.2

    License

    MIT

    Unpacked Size

    15.1 kB

    Total Files

    6

    Last publish

    Collaborators

    • gigatoride