0.1.2 • Published 4 years ago
ruqqus-api v0.1.2
node-ruqqus-api
This is an unofficial Node.js wrapper for Ruqqus API.
Installation
npm install --save ruqqus-api
Usage
import { Ruqqus } from 'ruqqus-api'
const ruqqus = new Ruqqus()
NOTE: make sure you've set "type"
in your package.json
to "module"
(if you saved your file with .js
extension), or saved your file with .mjs
extension.
Get guild's data
ruqqus.getGuildData('Webdev')
.then(console.log)
.catch(console.error)
// OR (in async/await)
try {
console.log(await ruqqus.getGuildData('Webdev'))
} catch (error) {
console.error(error)
}
Get user's data
ruqqus.getUserData('emposs')
.then(console.log)
.catch(console.error)
// OR (in async/await)
try {
console.log(await ruqqus.getUserData('emposs'))
} catch (error) {
console.error(error)
}
Get post's data
ruqqus.getPostData('1gck')
.then(console.log)
.catch(console.error)
// OR (in async/await)
try {
console.log(await ruqqus.getPostData('1gck'))
} catch (error) {
console.error(error)
}
Get comment's data
ruqqus.getCommentData('4ktl')
.then(console.log)
.catch(console.error)
// OR (in async/await)
try {
console.log(await ruqqus.getCommentData('4ktl'))
} catch (error) {
console.error(error)
}
Get guild's listing
ruqqus.getGuildListing('Webdev')
.then(console.log)
.catch(console.error)
// OR (in async/await)
try {
console.log(await ruqqus.getGuildListing('Webdev'))
} catch (error) {
console.error(error)
}
Changelog
See: CHANGELOG.md
License
MIT