key-of-dreamsgenerated emoji magrittes

联合创作 · 2023-09-30 01:28

key of dreams

a bot that generates emoji magrittes.

key of dreams

this is a twitter and mastodon bot written in javascript (typescript, actually) running on node.js.

you can run it on your computer or remix it into something new! you'll need node and yarn (and git) installed. then run:

git clone https://github.com/lostfictions/key-of-dreams
cd key-of-dreams
yarn install
yarn dev

in a server environment, this bot can be run with docker for an easier time. (i recommend dokku if you're looking for a nice way to develop and host bots.)

the bot needs environment variables if you want it to do stuff:

  • MASTODON_TOKEN: a Mastodon user API token (required)
  • MASTODON_SERVER: the instance to which API calls should be made (usually where the bot user lives.) (default: https://botsin.space/)
  • RESOURCE_DIR: the directory in which to search for image data. (default: the images already checked in to the repo.)
  • CRON_RULE: the interval between each post, in crontab format. (default: every four hours)

this bot uses the envalid package which in turn wraps dotenv, so you can alternately stick any of the above environment variables in a file named .env in the project root. (it's gitignored, so there's no risk of accidentally committing private API tokens you put in there.)

more bots?
浏览 4
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报