diff options
author | asciimoo <asciimoo@gmail.com> | 2013-10-15 00:19:25 +0200 |
---|---|---|
committer | asciimoo <asciimoo@gmail.com> | 2013-10-15 00:19:25 +0200 |
commit | 26c9c0e8be632e91523b946d709e2752fe4c0441 (patch) | |
tree | 6df66666e8fb82e7d4a7a24f1af68ca5e6271999 /examples | |
parent | 62f6d34b957638a47a25d41eebcf3466a97b31f0 (diff) | |
download | searxng-26c9c0e8be632e91523b946d709e2752fe4c0441.tar.gz searxng-26c9c0e8be632e91523b946d709e2752fe4c0441.zip |
[enh] examples added
Diffstat (limited to 'examples')
-rw-r--r-- | examples/basic_engine.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/examples/basic_engine.py b/examples/basic_engine.py new file mode 100644 index 000000000..1ed5a3388 --- /dev/null +++ b/examples/basic_engine.py @@ -0,0 +1,21 @@ + +def request(query, params): + '''pre-request callback + params<dict>: + method : POST/GET + headers : {} + data : {} # if method == POST + url : '' + ''' + + params['url'] = 'https://host/%s' % query + + return params + + +def response(resp): + '''post-response callback + resp: requests response object + ''' + return [resp.text] + |