mirror of https://github.com/dirtbags/moth.git
Merge branch 'master' of https://github.com/dirtbags/moth
This commit is contained in:
commit
b17e4b54b8
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,4 @@
|
|||
# Maintainer notes
|
||||
|
||||
Update `answer_words.txt` using `./update-words.sh`.
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
#!/bin/sh
|
||||
set +e
|
||||
|
||||
url='https://rawgit.com/first20hours/google-10000-english/master/google-10000-english-no-swears.txt'
|
||||
getter="curl -sL"
|
||||
fn="answer_words.txt"
|
||||
|
||||
filterer() {
|
||||
grep '......*'
|
||||
}
|
||||
|
||||
if ! curl -h >/dev/null 2>/dev/null; then
|
||||
getter="wget -q -O -"
|
||||
elif ! wget -h >/dev/null 2>/dev/null; then
|
||||
echo "[!] I don't know how to download. I need curl or wget."
|
||||
fi
|
||||
|
||||
$getter "${url}" | filterer > ${fn}.tmp \
|
||||
&& mv -f ${fn}.tmp ${fn}
|
|
@ -10,7 +10,7 @@ local token = cgi.fields['k'] or ""
|
|||
|
||||
-- Check answer
|
||||
local needle = token
|
||||
local haystack = koth.path("tokens.txt")
|
||||
local haystack = koth.path("state/tokens.txt")
|
||||
local found, err = koth.anchored_search(haystack, needle)
|
||||
|
||||
if (not found) then
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Open Puzzles</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="style.css" type="text/css">
|
||||
<link rel="stylesheet" href="res/style.css">
|
||||
<link rel="icon" href="res/luna-moth.svg" type="image/svg+xml">
|
||||
<link rel="icon" href="res/luna-moth.png" type="image/png">
|
||||
|
||||
<script src="res/common.js"></script>
|
||||
<script src="res/terminal.js"></script>
|
||||
<script src="res/puzzles.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Open Puzzles</h1>
|
||||
<div class="readme">
|
||||
<div id="puzzles"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -23,8 +23,8 @@
|
|||
<form action='cgi-bin/token.cgi'>
|
||||
Team Hash: <input name='t'><br>
|
||||
Token: <input name='k'><input type='submit'>
|
||||
</form>\n"
|
||||
</fieldset>\n"
|
||||
</form>
|
||||
</fieldset>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Open Puzzles</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="style.css" type="text/css">
|
||||
<link rel="stylesheet" href="res/style.css">
|
||||
<link rel="icon" href="res/luna-moth.svg" type="image/svg+xml">
|
||||
<link rel="icon" href="res/luna-moth.png" type="image/png">
|
||||
|
||||
<script src="res/common.js"></script>
|
||||
<script src="res/terminal.js"></script>
|
||||
<script src="res/puzzles.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Open Puzzles</h1>
|
||||
<div class="readme">
|
||||
<div id="puzzles"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1 @@
|
|||
puzzles-notoken.html
|
Loading…
Reference in New Issue