1.0.3 • Published 2 years ago

krunkmemes v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

KrunkMemes

An API to fetch Krunker Memes from r/KrunkerIO.

How To Use

First Install the package:-

npm install krunkmemes --save

Now,

// Importing the package.
const KrunkerMemes = require('krunkmemes')

//Then to get the memes, you have to use:-
const postFilterLimit = 100
KrunkerMemes.get(postFilterLimit, (data)=>{
    // Do anything with the data now.
    console.log(data)
})

Here postFilterLimit is the amount of posts on r/KrunkerIO it should filter to find memes. By default, it is set to 100.

Note: There aren't many memes on r/KrunkerIO, if you set limit to 100, ~15 memes are all you get.

Response Data

The Response Data is an Object. The data is located inside the data key as an Array of the Response Object.

Sample Response -

{
  data: [
    {
      author: 'reddit_author_username1',
      image: 'https://abcdef.png',
      upvoteRatio: 0.98,
      upvotes: 100,
      downvotes: 1,
      postedTime: 1650908160,
      redditURL: '/r/KrunkerIO/comments/abcd/efgh/',
      postTitle: 'efgh'
    },
    {
      author: 'reddit_author_username2',
      image: 'https://ghijklm.png',
      upvoteRatio: 1,
      upvotes: 6,
      downvotes: 0,
      postedTime: 1650896150,
      redditURL: '/r/KrunkerIO/comments/abcde/fghij',
      postTitle: 'fghij'
    }
  ],
  errors: []
}

-> The postedTime is UTC epoch. -> Rest is pretty self explanatory. -> Notice the errors array? It contains the Reddit URL of the meme posts it could not get the images of.

So Basically that's it! 💖