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);
})
Enableing debug mode and compression:
var devRant =require('rantscript');
devRant.httpSettings.SET_DEBUG(true);
console.log(devrant.httpSettings.GET_DEBUG());
//Returns TruedevRant.httpSettings.SET_COMPRESS(true);
console.log(devrant.httpSettings.GET_COMPRESS());
//Returns True
Logging in and posting a rant:
var devRant =require('rantscript');
//Get authentication token from devRant API
devRant
.login('username', 'password')
.then((response)=>{
//Then post a rant to devRant with token gotten from previous request.devRant.postRant(
"Rant Text",
"Tags, Separated, By, Commas",
response["auth_token"]
).then((resp)=>{
//Then console.log the rant data.console.log(resp);
})
})
The Tidelift Subscription provides access to a continuously curated stream of human-researched and maintainer-verified data on open source packages and their licenses, releases, vulnerabilities, and development practices.