- Automatically generate post with OpenAI and upload to Instagram (random language, topic, or set manually)
- Upload posts with embed codes to Instagram
- Set up posts with images & captions and upload them to Instagram
- Integrate with Discord Bot
- Automatically generate posts and upload them to Instagram at intervals.
Check more the generated posts at Instagram page coding.easily
Auto.Generate.Post.1.mov
create-post-with-image.mov
Create.Post.with.Code.1.mov
- Facebook Developer App
- Instagram Page
- Facebook Page to get access token
- AWS S3 Bucket to upload image
- OpenAI to generate posts
- Discord Server
-
App type: Business
-
FACEBOOK_ACCESS_TOKEN: We should use Long-Lived User Access Token because it never expires. Read more here
The documents said it must be Long-Live Page Access Token that is now wrong - expired time is only 2 hours
- Shorted-Lived access token: 1 hour
- Page Long-Lived access token: 2 hours
- User Long-Lived access token: never expired
$ pnpm install
cp .env.example .env
We need these env to start the app
FACEBOOK_ACCESS_TOKEN=
INSTAGRAM_ACCOUNT_ID=
AWS_S3_BUCKET_NAME=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=
OPENAPI_API_KEY=
DISCORD_APP_ID=
DISCORD_TOKEN=
DISCORD_PUBLIC_KEY=
DISCORD_CHANNEL_ID=
DISCORD_BUG_REPORT_CHANNEL_ID=
Add the copy-code2image-public script in package.json
to copy the code2image public director to your build folder.
Update the build/start:dev/start:debug script to use the copy-code2image-public script.
"scripts": {
"copy-code2image-public": "mkdirp dist/public && ncp node_modules/@harrylowkey/code2image/public dist/public",
"build": "npm run copy-code2image-public && nest build",
"start:dev": "npm run copy-code2image-public && nest start --watch",
"start:debug": "npm run copy-code2image-public && nest start --debug --watch",
}
# development
$ pnpm run start
# watch mode
$ pnpm run start:dev
# production mode
$ pnpm run start:prod