
RantScript allows you to access the whole devRant API via JS.
Install
npm install rantscript
Examples
Console logging the 10 top posts on devRant:
var devRant = require('RantScript');
devRant
.rants('top', 10, 0)
.then((response)=>{
console.log(response);
})
Logging in and posting a rant:
var devRant = require('RantScript');
devRant
.login('username', 'password')
.then((response)=>{
devRant.postRant(
"Rant Text",
"Tags, Separated, By, Commas",
response["auth_token"]["id"],
response["auth_token"]["key"],
response["auth_token"]["user_id"]
).then((resp)=>{
console.log(resp);
})
})
All Functions
| .rants | .rants('sort', limit, skip) | Load rants. |
| .rant | .rant(rant_id) | Load a single rant by id. |
| .search | .search('search term') | Search on devRant |
| .profile | .profile('Username') | Load a profile by name |
| .login | .login('Username','Password') | Get a devRant auth token |
| .postRant | .postRant('Rant', 'Tags', token_id, token_key, user_id) | Post a rant to devRant |
| .postComment | .postComment('Comment', rant_id, token_id, token_key, user_id) | Post a comment to a rant |
| .vote | .vote(<0 = down | 1 = up>, rant_id, token_id, token_key, user_id) |
| .voteComment | .voteComment(<0 = down | 1 = up>, rant_id, token_id, token_key, user_id) |