cheatwrap

1.0.1 • Public • Published

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()

Readme

Keywords

Package Sidebar

Install

npm i cheatwrap

Weekly Downloads

6

Version

1.0.1

License

MIT

Unpacked Size

12.4 kB

Total Files

7

Last publish

Collaborators

  • magicaltoast