Skip to content

A bot to automatically post to instagram from a google spreadsheet

Notifications You must be signed in to change notification settings

Kinzi/instagram-post-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Instagram Post Bot

What's this about?

Post images and captions from a google spreadsheet to instagram. The app is written in nodejs and best hosted (for free) on heroku. The app will fetch a random row from the spread and post it along with the caption. An additional caption string can be set in the code. After posting it will mark the row as posted in the spreadsheet so it will not be posted again.

How to set things up

  1. Set up a google spreadsheet with columns exactly like this demo It's important to keep the columns in this order and with these names as they will be used as object keys.

  2. Follow step 1 from this Google API tutorial for nodejs. Store this file under .credentials/client_secret.json in the root folder.

  3. Set your keys and passwords in the config.js file. All keys but "ADD_TO_CAPTION" can also be set as heroku environment variables. Use "/r" for line breaks in ADD_TO_CAPTION. Add a Heroku URL to automatically ping the app every 5 minutes to keep it alive.

Use cron notation to set post interval:

 *    *    *    *    *
 ┬    ┬    ┬    ┬    ┬
 │    │    │    │    │
 │    │    │    │    └ day of week (0 - 7) (0 or 7 is Sun)
 │    │    │    └───── month (1 - 12)
 │    │    └────────── day of month (1 - 31)
 │    └─────────────── hour (0 - 23)
 └──────────────────── minute (0 - 59)
  1. Run app locally with npm start. Open your Browser at localhost:5000 and hit the button. You will be prompted in the commandline to authenticate this app with google. AuthToken will be saved to credentials/. Follow the instructions and post the verification code to the commandline. You should be automatically logged in to instagram. The session also will be saved to credentials/.

  2. If everything works remove credentials/* from .gitignore and deploy the app along with the credentials to heroku

Frameworks/Repos Used

About

A bot to automatically post to instagram from a google spreadsheet

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published