1.0.1 • Published 5 years ago

cheatwrap v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

CheatWrap

Wrapper around snoowrap allowing the use of multiple API keys to bypass the limitation of a single key

Installation

npm i cheatwrap

Example

import CheatWrap from "./index"
import Snoowrap from "snoowrap" 

const credentials = [  
  {
    userAgent: "graph-from-reddit",
    clientId: process.env.ID,
    clientSecret: process.env.SECRET,
    username: process.env.USERNAME,
    password: process.env.PASSWORD,
  },
]

const getSweetCreatures = async (r: Snoowrap) => { 
  return await (await r.getSubreddit("aww").getHot()).fetchAll()
}

const main = async () => {
  const r = new CheatWrap(credentials)
  await r.run(getSweetCreatures)
}

main()