I hereby claim:
- I am akdh on github.
- I am akdh (https://keybase.io/akdh) on keybase.
- I have a public key ASDNjqhZzsWBYcg6CJ5ZdFsmONimsv8u3EBnrIUAYjWd5wo
To claim this, I am signing this object:
{ | |
"query": { | |
"bool": { | |
"must": { | |
"match": { | |
"title": { | |
"query": "mystery" | |
} | |
} | |
}, |
{ | |
"stories": { | |
"mappings": { | |
"story": { | |
"properties": { | |
"description": { | |
"type": "string" | |
}, | |
"title": { | |
"type": "string" |
action | datetime | query | document | |
---|---|---|---|---|
query | 2016-06-09 11:04:01 | the necromancer | ||
click | 2016-06-09 11:04:23 | the necromancer | 56534248 |
{ | |
"query": { | |
"bool": { | |
"must": { | |
"match": { | |
"title": { | |
"query": "The Necromancer" | |
} | |
} | |
}, |
{ | |
"stories": { | |
"mappings": { | |
"story": { | |
"properties": { | |
"description": { | |
"type": "string" | |
}, | |
"title": { | |
"type": "string" |
I hereby claim:
To claim this, I am signing this object:
import csv | |
import sys | |
VOTE_THRESHOLD = 2 | |
topics = {} | |
next_topic = 900 | |
for row in csv.reader(sys.stdin): | |
if row[1] == 'blah': |
See https://github.com/akdh/cst-tools for JSON schemas.
To run install the required dependencies and launch the server.
pip install flask jsonschema
python main.py
Suggestion requests can now be made to this server, see https://gist.github.com/akdh/564cbb5f9c6c92c99d8a.
See https://github.com/akdh/cst-tools for JSON schemas.
Assuming your service callback URL is http://127.0.0.1:5002/suggestions, you can make a request to your service and ensure that it is valid using the following commands:
curl -H "Content-Type: application/json" --data @request.json -XPOST http://127.0.0.1:5002/suggestions > response.json
python validate.py data.json 192
No errors should be produced.
import sys | |
import warc | |
import json | |
if len(sys.argv) != 2: | |
print("usage: %s FILENAME" % sys.argv[0]) | |
exit() | |
filename = sys.argv[1] |