diff options
-rw-r--r-- | cgi/bracket-api.cgi | 38 | ||||
-rwxr-xr-x | cgi/user.cgi | 6 | ||||
-rw-r--r-- | inc/bracket.json | 72 |
3 files changed, 74 insertions, 42 deletions
diff --git a/cgi/bracket-api.cgi b/cgi/bracket-api.cgi index f7af335..ad52600 100644 --- a/cgi/bracket-api.cgi +++ b/cgi/bracket-api.cgi @@ -1,42 +1,6 @@ require 'json' -puzzles = [ - { - "completionText" => "31st March 1998:", - "puzzleDate" => "2025-03-31", - "completionURL" => "https://en.wikipedia.org/wiki/Mozilla", - "solutions" => { - "Olive or grape plant, maybe" => "vine", - "Castrated male bovine" => "Bullock", - "1995 Sandra Bullock movie \"The ___\"": "Net", - "\"___ old fox\"" => "sly", - "Water meadows" => "ings", - "Mean" => "Par", - "Parents or siblings, for short" => "fam", - "Owls are famously this" => "Wise", - "Shrink" => "contract", - "Euclid's mathematical treatise" => "elements", - "\"No ____s!\": Wise words for superheroes" => "cape", - "________ table of the elements" => "periodic", - "A timed contract with a periodic payment" => "lease", - "Image made from smaller pieces" => "Mosaic", - "The Mosaic Killer" => "Mozilla", - "The start" => "source", - "\"You make a better ____ than a window!\"" => "door", - "\"____ wide!\"" => "open", - "One might enter this to open a door" => "code", - "One of the five senses" => "taste", - "In favour of" => "pro", - "The taste of protons" => "sour", - "Strong curved structure" => "arch", - "Monarch" => "king", - "Timmy never actually fell down one of these" => "well", - "Blood sucking skin dwellers" => "lice" - }, - "initialPuzzle" => "[1995 Sandra [Castrated male bo[Olive or grape plant, maybe]] movie \"The ___\"]s[\"No ____s!\": [Owls are [[Mean]ents or sibl[Water meadows], for short]ou[\"___ old fox\"] this] words for superheroes] re[A timed [Shrink] with a [________ table of the [Euclid's mathematical treatise]] payment]s [The [Image made from smaller pieces] Killer] [The start] [One might enter this to open a [\"You make a better ____ than a window!\"]] under an [\"____ wide!\"] [The [One of the five senses] of [In favour of]tons]ce [Blood suc[Mon[Strong curved structure]] skin d[Timmy never actually fell down one of these]ers]nse.", - "puzzleSolution" => "Netscape releases Mozilla source code under an open source license." - } -] +puzzles = JSON.parse(File.read("../inc/bracket.json")) path = $cgi.path_info.split(?/) $pdata = if path.length == 3 diff --git a/cgi/user.cgi b/cgi/user.cgi index cc36bb6..535e580 100755 --- a/cgi/user.cgi +++ b/cgi/user.cgi @@ -93,9 +93,5 @@ when /^\/stuff-i-want/ page("Stuff I Want") when /^\/bracket-api/ load "bracket-api.cgi" - $cgi.out({ - "Content-Type": "application/json", - "Access-Control-Allow-Origin": "https://dan.york.ac.uk", - "Access-Control-Allow-Headers": "cache-control, pragma" - }) { $pdata } + $cgi.out("application/json") { $pdata } end diff --git a/inc/bracket.json b/inc/bracket.json new file mode 100644 index 0000000..f98de8b --- /dev/null +++ b/inc/bracket.json @@ -0,0 +1,72 @@ +[ + { + "completionText": "1st April 1983:", + "puzzleDate": "2025-04-01", + "completionURL": "https://www.york.ac.uk/it-services/about/news/our-history", + "solutions": { + "So good they named it once": "York", + "Coal or great, perhaps": "tit", + "Consule food": "eat", + "Not science": "art", + "Not art": "science", + "Second in command": "vice", + "\"___ equals ___\", Brecht play": "man", + "A leap one is controversial": "Second", + "There are several on Mars": "rovers", + "Awarder of degrees": "University", + "Location in a hospital": "ward", + "Eject liquid from the mouth": "spit", + "Entirely reliant": "dependent", + "🐱": "cat", + "Person or machine that performs calculations": "Computer", + "Male offspring": "son", + "Projection of the jaw": "chin", + "___-de-sac": "cul", + "Opposite of get": "put", + "One of four on a car": "tire", + "Maker of Robins and Scimitars": "reliant", + "Red harbinger birds of Christmas": "Robins", + "Indulge excessively": "binge", + "1001 to Constantine": "mi", + "Always the same": "Constant", + "Sterling, colloquially": "quid" + }, + "initialPuzzle": "The [A[Lo[🐱]ion in a ho[Eject li[Sterling, colloquially] from the mouth]al]er of degrees] of [So good they named it once] Com[Opposite of get]ing Ser[A leap one is cont[There are several on Mars]ial] in com[\"___ equals ___\", Brecht play]d], formerly p[Not science] of [Per[Male offspring] or ma[Projection of the jaw]e that performs cal[___-de-sac]ations] [Not art], became an in[Entirely [Maker of [Red har[Indulge excessively]r of Christmas] and Sci[1001 to [Always the same]]tars]] en[Coal or gr[Consume food], perhaps]y.", + "puzzleSolution": "The University of York Computing Service, formerly part of Computer Science, became an independent entity." + }, + { + "completionText": "31st March 1998:", + "puzzleDate": "2025-03-31", + "completionURL": "https://en.wikipedia.org/wiki/Mozilla", + "solutions": { + "Olive or grape plant, maybe": "vine", + "Castrated male bovine": "Bullock", + "1995 Sandra Bullock movie \"The ___\"": "Net", + "\"___ old fox\"": "sly", + "Water meadows": "ings", + "Mean": "Par", + "Parents or siblings, for short": "fam", + "Owls are famously this": "Wise", + "Shrink": "contract", + "Euclid's mathematical treatise": "elements", + "\"No ____s!\": Wise words for superheroes": "cape", + "________ table of the elements": "periodic", + "A timed contract with a periodic payment": "lease", + "Image made from smaller pieces": "Mosaic", + "The Mosaic Killer": "Mozilla", + "The start": "source", + "\"You make a better ____ than a window!\"": "door", + "\"____ wide!\"": "open", + "One might enter this to open a door": "code", + "One of the five senses": "taste", + "In favour of": "pro", + "The taste of protons": "sour", + "Strong curved structure": "arch", + "Monarch": "king", + "Timmy never actually fell down one of these": "well", + "Blood sucking skin dwellers": "lice" + }, + "initialPuzzle": "[1995 Sandra [Castrated male bo[Olive or grape plant, maybe]] movie \"The ___\"]s[\"No ____s!\": [Owls are [[Mean]ents or sibl[Water meadows], for short]ou[\"___ old fox\"] this] words for superheroes] re[A timed [Shrink] with a [________ table of the [Euclid's mathematical treatise]] payment]s [The [Image made from smaller pieces] Killer] [The start] [One might enter this to open a [\"You make a better ____ than a window!\"]] under an [\"____ wide!\"] [The [One of the five senses] of [In favour of]tons]ce [Blood suc[Mon[Strong curved structure]] skin d[Timmy never actually fell down one of these]ers]nse.", + "puzzleSolution": "Netscape releases Mozilla source code under an open source license." + } +] |