russell.ballestrini.net/golf.py

5 lines
No EOL
365 B
Python

#!/usr/bin/env python3
import http.server as h,urllib.request as u,urllib.parse as p
class S(h.BaseHTTPRequestHandler):
def do_GET(s):q=dict(p.parse_qsl(p.urlparse(s.path).query));s.send_response(200);s.end_headers();s.wfile.write(str(q.get('keyword','')in u.urlopen(q.get('target','')).read().decode()).lower().encode())
h.HTTPServer(('',31337),S).serve_forever()