Code Monkey home page Code Monkey logo

key-of-dreams's Introduction

key of dreams

a bot that generates emoji magrittes.

key of dreams

this is a bot that generates images and posts them to mastodon and twitter. it's written in typescript and runs on node.js.

you can run it on your computer and even remix it into something new! you'll need node and git installed. if you install node manually, you should match the node version listed in the .node-version file โ€” but instead of installing node directly i recommend using fnm, which can automatically handle installing and switching node versions by detecting .node-version files.

once you're set, run:

git clone https://github.com/lostfictions/key-of-dreams
cd key-of-dreams
corepack enable # enables use of the pnpm package manager
pnpm install
pnpm dev

running pnpm dev will generate an image and save it to a file on your computer. when posting to the internet, this bot runs using github actions' scheduled events. check out the workflow file for more details.

if you clone the repository you can run your own remixed version that posts to mastodon using github actions too! no need to edit the workflow file โ€” you'll just need to set some environment variables in the github repository settings:

  • 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 to search for image and font data. (default: the images already checked in to the repo.)

this bot uses dotenv, so if you're testing things locally, you can 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.)

key-of-dreams's People

Contributors

lostfictions avatar

Stargazers

Enric Granzotto Llagostera avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.