Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: API to allow programmatic creation #35

Open
Fuzzwah opened this issue Nov 17, 2019 · 2 comments
Open

feature request: API to allow programmatic creation #35

Fuzzwah opened this issue Nov 17, 2019 · 2 comments

Comments

@Fuzzwah
Copy link

Fuzzwah commented Nov 17, 2019

I'd like to rig up my slackbot to allow users to create versions of these images via triggers. Any chance of making an API available?

@TheLastZombie
Copy link

See http://floppy.foone.org/w/Death_Generator:

Two commonly asked questions are "Does the death generator have an API?" and "Can I easily run it from the command line?" and the answer to both questions is no. Both are on the to-do list but can't really be done with the current design.

The main obstacle is that it's HTML canvas based and explicitly tied to the HTML page it works with. At some point I'll split it out and use some kind of canvas wrapper to let you run it from the command line as a node.js app, but not that hasn't been done yet.

If you really really need to generate from the command line, you can. Not easily or quickly, but you can with a bit of work: Look into evaluate_test_cases.js. This is a node.js script that takes in a JSON file and then runs some headless Chromium instances against it, returning the output images (at 1:1 scaling instead of the default 2:1, you may want to disable this depending on your needs) encoded into JSON. test.py contains some example code for extracting the images from the response JSON.

@skhaz
Copy link

skhaz commented Feb 28, 2020

I did a telegram bot[0] using puppeteer and other tools.

0 - https://github.com/skhaz/telegram-sierradeathgenerator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants