image-grabberjs
v1.0.7
Published
**Image-Grabber-JS is a module that pulls images from reddit.**
Downloads
2
Maintainers
Readme
Image Grabber JS
Image-Grabber-JS is a module that pulls images from reddit.
Developed by Gautam Paranjape
Images are actually fetched from an API I made, and this is the package that covers it. http://img-grabber-js.glitch.me/
API repo: https://github.com/gautam-paranjape/random-image-api
- Fetched from an API
- Clean and Efficient
- Lightweight
- Type Safe
Installation
npm install image-grabberjs
Documentation
Example
const { fetchReddit } = require("image-grabberjs");
const subreddit = "catpictures";
let fetchedImage = fetchReddit(subreddit);
console.log(fetchedImage);
One thing to note, the function must be asynchronous.
This package is used a lot for discord bots, as people want to make image commands. Thus, here is an example to help people, using the library discord.js
const grabber = require("image-grabber");
let subreddit = "dogpictures";
let image = await grabber(subreddit);
const embed = new MessageEmbed();
embed.setTitle("Dog!");
embed.setImage(image);
embed.setColor("RANDOM");
message.channel.send(embed);
The possibilities are endless, you can use this to grab images from any subreddit you want!
You can use JavaScript to use this package in a whole different way!
Contribution
Contributions are absolutely welcome!
Please visit the GitHub repo, fork it, add your changes, and then make a pull request, and I will review it.
Thank you so much, and hopefully you found this package helpful!