diff options
| author | Adam Tauber <asciimoo@gmail.com> | 2014-12-19 20:06:21 +0100 |
|---|---|---|
| committer | Adam Tauber <asciimoo@gmail.com> | 2014-12-19 20:06:21 +0100 |
| commit | 813247b37ab00a1496468df4cff33199ae04d6b4 (patch) | |
| tree | 0451d2bd843f4429a11668a2972e6a9545de4296 /searx/engines/faroo.py | |
| parent | 1c969186bfdabbc5d6c804fa5f1f2fc068492b5f (diff) | |
| parent | a508d540ac43196edeb4d946dfdf64a1d0a438ed (diff) | |
Merge pull request #152 from pointhi/search_engines
[enh] add photon engine, and fix pep8 errors
Diffstat (limited to 'searx/engines/faroo.py')
| -rw-r--r-- | searx/engines/faroo.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/searx/engines/faroo.py b/searx/engines/faroo.py index dada4758d..5360ea156 100644 --- a/searx/engines/faroo.py +++ b/searx/engines/faroo.py @@ -22,10 +22,17 @@ api_key = None # search-url url = 'http://www.faroo.com/' -search_url = url + 'api?{query}&start={offset}&length={number_of_results}&l={language}&src={categorie}&i=false&f=json&key={api_key}' +search_url = url + 'api?{query}'\ + '&start={offset}'\ + '&length={number_of_results}'\ + '&l={language}'\ + '&src={categorie}'\ + '&i=false'\ + '&f=json'\ + '&key={api_key}' # noqa search_category = {'general': 'web', - 'news': 'news'} + 'news': 'news'} # do search-request @@ -80,8 +87,8 @@ def response(resp): # parse results for result in search_res['results']: if result['news']: - # timestamp (how many milliseconds have passed between now and the beginning of 1970) - publishedDate = datetime.datetime.fromtimestamp(result['date']/1000.0) + # timestamp (milliseconds since 1970) + publishedDate = datetime.datetime.fromtimestamp(result['date']/1000.0) # noqa # append news result results.append({'url': result['url'], |