-
Notifications
You must be signed in to change notification settings - Fork 9
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: Simple REST(?) API for adding puzzles #1948
Comments
Huh, I don't think I had realized there was a JSON dump. We've had an open ticket (#237) to build this kind of scraping into Jolly Roger for ages, but I'd also be pretty open to exposing an API for external scripting. We do have some basic REST API structure. Right now it exists to allow a third-party team website to use Jolly Roger as an authz source, but it shouldn't be terribly hard to extend. Some basic notes on how it works (since we should - but don't currently - have any docs):
|
@ebroder (get your barf bag out) as a stopgap, would just adding an entry to the database do the right thing as far as adding a puzzle? (obviously very brittle and to be replaced with a proper API in future) or is there enough denormalized content around puzzle creation (not to mention sheet creation, etc) that it would be way too hard? |
Hmm. It might work? I definitely wouldn't recommend it. Main thing I'll note is to make sure you get the types right (although the database schema should enforce it). I think the main functionality you'll lose is the ability to create puzzles with Google Docs instead of Sheets - may not be important to you but we tend to use it for meta-hunt things. If you really want to hack something together, I might try to find a standalone DDP client (a la https://github.com/Gregivy/simpleddp) and invoke the Meteor methods that way. |
FYI, https://github.com/jpd236/jolly-roger/tree/add-puzzle-api is an initial pass at a proper API for adding puzzles. There are also APIs to list hunts and tags for a hunt to complete the picture. I didn't add an API to list puzzles for dupe checks, but this branch is built atop #2313 which attempts to detect duplicate puzzles on addition, so that should be handled. I plan to send this as a PR once we've aligned on the approach to deduping (which I imagine won't happen until after this year's hunt), but maybe it'll be useful if you want something for this year. No promises it doesn't have weird bugs as it's wholly unreviewed. |
We have users (@dougz) who like to write little scrapers to auto-populate our solving aids from the Hunt site. In recent years, Hunt site runners have been offering puzzle lists in JSON or otherwise machine-readable format which is amazing!
To make this easier to do it would be neat to have some very simple interface which scripts could use to add puzzles. (And maybe enumerate existing puzzles, so they could check for dupes.)
The text was updated successfully, but these errors were encountered: