Automated Daily Instagram Posts with Node.js, Express, and TypeScript
Report Issue
·
Follow @dailypixelmike
This project is an Express server that posts the same locally-stored picture of Pixel Mike Wazowski to the @dailypixelmike Instagram page every day at 12 PM Eastern Time via node-cron and instagram-web-api. The image is in JPG format since that is Instagram's default format for images. Any other image format will be converted to JPG by Instagram and hence lose some of its quality in the conversion process.
Every post includes a custom caption that includes Pixel Mike's "feeling" of the day. This "feeling" is a random adjective or adverb generated by wordpos, which pulls lexicographic data from WordNet online. Each caption also includes a definition for the adjective or adverb, which is also provided by wordpos and parsed to make a complete sentence. Additional hashtags are also included in an automated comment by @dailypixelmike on each of @dailypixelmike's daily Instagram posts.
The server initially logs in to Instagram with a username and password. It then persists the authenticated cookies in a cookie store via tough-cookie-filestore2 for future use. The server is deployed to Heroku and the Heroku dyno kept awake with UptimeRobot.
I have also created a YouTube tutorial for this project. It includes configuring Heroku, setting up an Instagram client, and configuring a cookie store.
To set up this project locally, you can follow the steps below.
You will need to have the following software installed:
- npm
- Git
- Node.js
- Create your own Instagram account.
- Clone the Github repository.
git clone https://github.com/amamenko/daily-pixel-mike.git
- Install all server-side NPM packages.
npm install
- Add your server-side environment variables.
INSTAGRAM_USERNAME=YOUR INSTAGRAM USERNAME INSTAGRAM_PASSWORD=YOUR INSTAGRAM PASSWORD
- Start the local server.
npm start
Contributions are welcome!
- Fork the project.
- Create your feature branch (
git checkout -b feature/MyFeature
). - Commit your changes (
git commit -m 'Add my feature'
). - Push to the branch (
git push origin feature/MyFeature
). - Open a pull request.
Distributed under the MIT License. See LICENSE.txt
for more information.
Avraham (Avi) Mamenko - avimamenko@gmail.com
Project Link: https://github.com/amamenko/daily-pixel-mike