Usage

You can run permanent process which will generate and publish tweets in random moments during day:

Build project:

npm run build

Run process:

npm run start

Keep in mind that you need to authorize with OAuth. For that go to http://localhost:3000/auth and follow instructions. Reminder about authorization will be also displayed in terminal.

As OAuth token is stored in MongoDB you need to authorize only once and it will also work in different scripts.

Scripts

You also can configure some cron jobs to run scripts in specific moments of day.

Before configuring cron jobs you need to authorize in Twitter with OAuth. For that run npm run auth and go to http://localhost:3000/auth.

npm run auth

publish-post - generates and publishes tweet:

npm run publish-post

publish-post-random - generates and publishes tweet with probability defined by CHANCE environment variable:

npm run publish-post-random