UNPKG

2.43 kBMarkdownView Raw
1# node-utopian-rocks
2
3[![GitHub license](https://img.shields.io/github/license/gigatoride/node-utopian-rocks.svg)](https://github.com/gigatoride/node-utopian-rocks/blob/master/LICENSE)
4![GitHub license](https://img.shields.io/badge/powered%20by-utopian.io-ff69b4.svg)
5
6An API wrapper for utopian.rocks.
7
8# Installing
9
10Using npm:
11
12```cmd
13npm install node-utopian-rocks
14```
15
16
17# Usage
18
19First add it to your project
20
21```js
22// Using CommonJS modules
23const utopian = require('node-utopian-rocks');
24```
25
26For example retrieving posts by category and status ``Asynchronously``:
27
28```js
29await utopian.getPosts('development', 'reviewed')
30
31```
32
33or by using ``.then()`` method:
34
35```js
36utopian.getPosts('development', 'reviewed').then(posts => posts);
37```
38
39Or Let's run some tests:
40
41```
42npm test
43```
44
45# API
46
47## Request method aliases
48
49`` utopian.getPosts(params) ``
50
51`` utopian.getModerators() ``
52
53`` utopian.getStats(params) ``
54
55
56## Request parameters
57These are the available parameters for making requests.
58
59We will start with posts ``object``:
60
61```js
62utopian.getPosts(category, status, author, moderator, staff_picks)
63```
64
65Any parameter can be ignored by empty string or just null
66
67```js
68utopian.getPosts(category, null, author, null, staff_picks)
69```
70
71## Supported Tags
72
73Tag | Task tag
74--|--
75development | task-development
76copywriting | task-copywriting
77graphics | task-graphics
78analysis | task-analysis
79social | task-social
80documentation | task-documentation
81blog |
82bug-hunting |
83ideas |
84video-tutorials |
85tutorials |
86
87For moderators ``object`` it should be called without any parameters.
88
89```js
90utopian.getModerators();
91```
92
93For Statistics
94
95```js
96/**
97 * you can use a specific date like 2018-05-24 or today, weekly.
98 * Those are the available sections for stats:
99 * moderators, categories, projects, staff_picks, task_requests
100 * any thing else will retrieve all sections.
101 */
102utopian.getStats(specificDate, section);
103```
104
105# Roadmap
106
107- Adding any upcoming API calls that will be available on https://utopian.rocks
108- More improvements and more advanced options, configs.
109
110# Contributing
111
112Feel free to create any [pull requests](https://github.com/gigatoride/node-utopian-rocks/compare).
113
114# Bugs
115
116If there is any bug please report it by opening a [new issue](https://github.com/gigatoride/node-utopian-rocks/issues/new).