Skip to content

This bot provides the image data needed to power my other project, called “CalmSlides”. It runs as a worker bot on Heroku making requests to the Unsplash API at regular intervals and storing this data on MongoDB.

Notifications You must be signed in to change notification settings

Ola4606/Calm-Slides-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CalmSlides Bot

Bot

MongoDB Collection of Images Data stored by the CalmSlides bot

This bot was built using NodeJS, and it simply makes a request to the Unsplash API every 2mins (using the node-schedule NPM package) to receive data on 30 images.

Why I created this bot? I created this bot to solve a problem. I needed thousands of Unsplash images each time a user wanted to have a “relaxation session” on my other project “CalmSlides”, and the Unsplash API (in development mode) restricts the number of requests I can make to 50 requests per hour (Note: in each request I can retrieve data on up to 30 images maximum) .

Hence to solve this problem I created a bot that made requests for all the image data I could need on the website beforehand, and store it on MongoDB, so I would not need to make an API call each time I needed the images on “CalmSlides”. The bot ran for 4 days, and stored data on 92,813 images, before I shut it down (temporarily).

It uses the mongoose NPM package to connect to MongoDB and store data in the database.During this project, I learned how to store data in MongoDB by creating Schemas and Models.

Key NPM Packages used: node-fetch, mongoose, node-schedule, unsplash-js, dotenv

Read on more of my projects over on my website: Adeyemo OlaOluwa

About

This bot provides the image data needed to power my other project, called “CalmSlides”. It runs as a worker bot on Heroku making requests to the Unsplash API at regular intervals and storing this data on MongoDB.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published