node-utopian-rocks

An API wrapper for utopian.rocks.


Keywords
node, api, wrapper, utopian
License
MIT
Install
npm install node-utopian-rocks@0.0.2

Documentation

node-utopian-rocks

Build Status npm GitHub license install size Utopian

An API wrapper for utopian.rocks.

Installing

npm install node-utopian-rocks

Usage

Add it to your project:

const utopian = require("node-utopian-rocks");

For example retrieving posts by category and status async await:

(async () => {
  const posts = await utopian.getPosts("social", "reviewed");
  console.log(posts);
})();

Using .then() method:

utopian
  .getPosts("development", "reviewed")
  .then(console.log)
  .error(console.log);

API

Request method aliases

utopian.getPosts(params)

utopian.getModerators()

utopian.isModerator(param)

utopian.stats.getModerators(params)

utopian.stats.getProjects(params)

utopian.stats.getContributors(params)

utopian.stats.getModeratorsByDate(param)

utopian.stats.getProjectsByDate(param)

utopian.stats.getStaffPicksByDate(param)

utopian.stats.getCategoriesByDate(param)

utopian.stats.getTasksRequestsByDate(param)

Request parameters

These are the available parameters for making requests.

We will start with posts Array of Objects: We will start with posts:

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 array it should be called without any parameters. For moderators array:

utopian.getModerators();

For Statistics:

/**
 * It will return total contributes by selected parameters
 * staff_picked should be true or false.
 * you can ignore any param by just null.
 */
utopian.stats.getContributors(category, status, staff_picked);
/**
 * You can use a specific date like 2018-05-24 or today, weekly.
 */
utopian.stats.getProjectsByDate(specificDate);

Supported Tags

the following table is the correct values for category parameter

Tag Task tag
development task-development
copywriting task-copywriting
graphics task-graphics
analysis task-analysis
social task-social
documentation task-documentation
blog
bug-hunting
ideas
video-tutorials
tutorials
anti-abuse

Roadmap

  • Adding any upcoming API calls that will be available on 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.