Accept keyboard submissions and forward the query with its selected search scope.
17 lines
460 B
Python
17 lines
460 B
Python
from twisted.web import resource
|
|
|
|
from hatena import request_args
|
|
from reximemo import search_keyboard_response
|
|
|
|
|
|
class PyResource(resource.Resource):
|
|
isLeaf = True
|
|
|
|
def render_POST(self, request):
|
|
kind = "creators" if (request_args(request).get("kind") or [""])[0] == "creators" else "flipnotes"
|
|
return search_keyboard_response(request, kind)
|
|
|
|
def render_GET(self, request):
|
|
request.setResponseCode(405)
|
|
return b""
|
