Post reddit content to instagram
- Add new bot(s) to
./bots
exports - Set arguments
- Run
npm start
On a scheduled run a bot will scrape content from one of the subreddits and post it to the instagram account with given credentials.
All bots are started and managed by pm2. Bot options are passed via arguments. You can either load bots on startup or start them from an api endpoint.
required:
--subreddits
: List of subbredit names (comma seperated)--schedule
: The bots posting schedule in crontab syntax (seconds granularity)--insta
: The instragram credentials as"username:password"
optional:
--tags
: List of tag names (without #'s) included on every post (comma seperated)--explore
: The bot will go to the instagram explore page and like content
the explore job runs on a random schedule
On startup all the bots exported from /bots
will be loaded. A bot config follows the pm2 app declaration and must at least contain following properties:
export function memes() {
return {
name: 'memes',
args: '--subreddits images --schedule "0 10 * * *" --insta user:pass',
};
}
Clone the repository
Install dependencies
npm install
Running the app:
-
Use
npm run dev
. This will compile all files and start processes (bots and api) with pm2. The bots are specified inbots/*
-
Debug with vscode (see launch.json)
When running the app with NODE_ENV=development
api requests do not require an api key. Also the puppeteer launch config is not headless.
You can run all tests with npm run test
or debug tests with vscode.