Narcoleptic Pasta Manufacturer
    Have ideas to improve npm?Join in the discussion! »

    @fabricio-191/images
    TypeScript icon, indicating that this package has built-in type declarations

    0.1.0-4 • Public • Published

    License

    These images are obtained from Reddit

    • The images will never repeat (for each key), until you have request all images we have in each category, when that happens, you will get a random image of all the images in that category, until there are new images.

    • Images are added automatically, so we don't have full control over whether they are in the correct category. but reddit moderation usually doesn't take long.

    • Here you can see how many images we have for each category

    If you have any error you can contact me on Discord

    Use example

    const key = 'RTFD2312';
    /*
    The 'key' must be a string, password-like or username-like, 
    is an identificator for each requester, so we can send unrepeated images, 
    if not key is supplied one random is generated, but the key is not stored. 
    So when you restart the Node.js process, another key is generated.
    */
    const Images = require('@fabricio-191/images').init(key);
    /*
    or:
    const Images = require('@fabricio-191/images');
    const images = new Images(key);
    */
    
    Images.sfw.cat()
    	.then(console.log)
    	.catch(console.error);
    
    Images.getFromSubreddit('nsfw') //subreddit name
    	.then(console.log)
    	.catch(console.error);
    
    Images.search('runescape') //search query
    	.then(console.log)
    	.catch(console.error);

    It is much more possible that the methods search and getFromSubreddit fail to get images

    Results of the search method will usualy NOT going to be NSFW even searching for something nsfw

    All methods return promises, the result are always an object like this:

    {
      title: 'Retro loaf from Peanut!',
      url: 'https://i.redd.it/qwxkdq2vbaf51.jpg',
      author: 'borzdeep',
      createdAtUTC: 2020-08-06T01:28:22.000Z, //Date or null cause an error in the API
      subreddit: 'Catloaf'
    }

    List of methods

    If you have any suggerences or ideas for categories, contact us on Discord

    search
    
    getFromSubreddit
    
    sfw
     |--cat
     |--dog
     |--bird
     |--wallpapers
     |--food
     |--programming
     |--humor
     |--memes
     |--irl
    
    nsfw
     |--general
     |--milf
     |--teen
     |--amateur
     |--hentai
     |--rule34
     |--ecchi
     |--furry
     |--yiff
     |--bdsm
     |--blowjob
     |--ass
     |--anal
     |--boobs
     |--feet
     |--thighs
     |--pussy
     |--curvy
     |--petite
     |--cum
     |--asian
     |--indian
     |--japanese
     |--korean
     |--ebony
     |--white
     |--gif
     |--hardcore
     |--hd
     |--lesbian
     |--masturbation
     |--men
     |--handholding
     |--outfit
     |--bikini
     |--costumes
     |--public
     |--trans
     |--other
     |--gore
     |--gay
     |--bara
     |--yaoi
    

    To-do:

    • Add more categories
    • Get a better host for the API
    • Add rate limits for the API

    Install

    npm i @fabricio-191/images

    DownloadsWeekly Downloads

    49

    Version

    0.1.0-4

    License

    Apache License 2.0

    Unpacked Size

    24.3 kB

    Total Files

    9

    Last publish

    Collaborators

    • avatar