1.1.1 • Published 5 years ago
corynth-api v1.1.1
Corynth API
How to use it
const api = require("corynth-api")
The meme function which grabs a random meme
Input:
api.meme().then(meme => console.log(meme))
or
const meme = await api.meme()
console.log(meme)
Output:
{"meme": "image url", "subreddit": "subreddit name"}
The reddit function which grabs an image from a subreddit of your choice
Input:
api.reddit('memes').then(reddit => console.log(reddit))
or
const reddit = await api.reddit('memes')
console.log(reddit)
Output:
{"subreddit": "subreddit name", "image": "image url"}
Coronavirus Class - Powered by corona.lmao.ninja
How to define it
const corona = new api.Corona()
Getting world data
corona.world().then(data=> console.log(data))
or
const data = await corona.world()
console.log(data)
Output:
{
"cases":0,
"recovered":0,
"dead":0,
"critical":0,
"tests":0,
"deaths_today":0,
"cases_today":0 //These would be real numbers
}
Getting country data
corona.country('country name').then(data=> console.log(data))
or
const data = await corona.country('country name')
console.log(data)
Output:
{
"country": "country name",
"cases":0,
"recovered":0,
"dead":0,
"critical":0,
"tests":0,
"deaths_today":0,
"cases_today":0 //These would be real numbers
}