forked from zaclys/searxng
[fix] pep8 : engines (errors E121, E127, E128 and E501 still exist)
This commit is contained in:
parent
ffcec383b7
commit
7c13d630e4
|
@ -1,7 +1,8 @@
|
|||
## Bing (Web)
|
||||
#
|
||||
# @website https://www.bing.com
|
||||
# @provide-api yes (http://datamarket.azure.com/dataset/bing/search), max. 5000 query/month
|
||||
# @provide-api yes (http://datamarket.azure.com/dataset/bing/search),
|
||||
# max. 5000 query/month
|
||||
#
|
||||
# @using-api no (because of query limit)
|
||||
# @results HTML (using search portal)
|
||||
|
|
|
@ -1,17 +1,19 @@
|
|||
## Bing (Images)
|
||||
#
|
||||
# @website https://www.bing.com/images
|
||||
# @provide-api yes (http://datamarket.azure.com/dataset/bing/search), max. 5000 query/month
|
||||
# @provide-api yes (http://datamarket.azure.com/dataset/bing/search),
|
||||
# max. 5000 query/month
|
||||
#
|
||||
# @using-api no (because of query limit)
|
||||
# @results HTML (using search portal)
|
||||
# @stable no (HTML can change)
|
||||
# @parse url, title, img_src
|
||||
#
|
||||
# @todo currently there are up to 35 images receive per page, because bing does not parse count=10. limited response to 10 images
|
||||
# @todo currently there are up to 35 images receive per page,
|
||||
# because bing does not parse count=10.
|
||||
# limited response to 10 images
|
||||
|
||||
from urllib import urlencode
|
||||
from cgi import escape
|
||||
from lxml import html
|
||||
from yaml import load
|
||||
import re
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
## Bing (News)
|
||||
#
|
||||
# @website https://www.bing.com/news
|
||||
# @provide-api yes (http://datamarket.azure.com/dataset/bing/search), max. 5000 query/month
|
||||
# @provide-api yes (http://datamarket.azure.com/dataset/bing/search),
|
||||
# max. 5000 query/month
|
||||
#
|
||||
# @using-api no (because of query limit)
|
||||
# @results HTML (using search portal)
|
||||
|
@ -57,12 +58,12 @@ def response(resp):
|
|||
url = link.attrib.get('href')
|
||||
title = ' '.join(link.xpath('.//text()'))
|
||||
contentXPath = result.xpath('.//div[@class="sn_txt"]/div//span[@class="sn_snip"]//text()')
|
||||
if contentXPath != None:
|
||||
if contentXPath is not None:
|
||||
content = escape(' '.join(contentXPath))
|
||||
|
||||
# parse publishedDate
|
||||
publishedDateXPath = result.xpath('.//div[@class="sn_txt"]/div//span[contains(@class,"sn_ST")]//span[contains(@class,"sn_tm")]//text()')
|
||||
if publishedDateXPath != None:
|
||||
if publishedDateXPath is not None:
|
||||
publishedDate = escape(' '.join(publishedDateXPath))
|
||||
|
||||
if re.match("^[0-9]+ minute(s|) ago$", publishedDate):
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
|
||||
from urllib import urlencode
|
||||
from json import loads
|
||||
from lxml import html
|
||||
|
||||
# engine dependent config
|
||||
categories = ['videos']
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
## DuckDuckGo (Web)
|
||||
#
|
||||
# @website https://duckduckgo.com/
|
||||
# @provide-api yes (https://duckduckgo.com/api), but not all results from search-site
|
||||
# @provide-api yes (https://duckduckgo.com/api),
|
||||
# but not all results from search-site
|
||||
#
|
||||
# @using-api no
|
||||
# @results HTML (using search portal)
|
||||
|
@ -9,7 +10,8 @@
|
|||
# @parse url, title, content
|
||||
#
|
||||
# @todo rewrite to api
|
||||
# @todo language support (the current used site does not support language-change)
|
||||
# @todo language support
|
||||
# (the current used site does not support language-change)
|
||||
|
||||
from urllib import urlencode
|
||||
from lxml.html import fromstring
|
||||
|
|
|
@ -27,6 +27,7 @@ search_url = url + 'api?{query}&start={offset}&length={number_of_results}&l={lan
|
|||
search_category = {'general': 'web',
|
||||
'news': 'news'}
|
||||
|
||||
|
||||
# do search-request
|
||||
def request(query, params):
|
||||
offset = (params['pageno']-1) * number_of_results + 1
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
## Google (Images)
|
||||
#
|
||||
# @website https://www.google.com
|
||||
# @provide-api yes (https://developers.google.com/web-search/docs/), deprecated!
|
||||
# @provide-api yes (https://developers.google.com/web-search/docs/),
|
||||
# deprecated!
|
||||
#
|
||||
# @using-api yes
|
||||
# @results JSON
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
## Google (News)
|
||||
#
|
||||
# @website https://www.google.com
|
||||
# @provide-api yes (https://developers.google.com/web-search/docs/), deprecated!
|
||||
# @provide-api yes (https://developers.google.com/web-search/docs/),
|
||||
# deprecated!
|
||||
#
|
||||
# @using-api yes
|
||||
# @results JSON
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
## Vimeo (Videos)
|
||||
#
|
||||
# @website https://vimeo.com/
|
||||
# @provide-api yes (http://developer.vimeo.com/api), they have a maximum count of queries/hour
|
||||
# @provide-api yes (http://developer.vimeo.com/api),
|
||||
# they have a maximum count of queries/hour
|
||||
#
|
||||
# @using-api no (TODO, rewrite to api)
|
||||
# @results HTML (using search portal)
|
||||
|
@ -39,7 +40,8 @@ def request(query, params):
|
|||
query=urlencode({'q': query}))
|
||||
|
||||
# TODO required?
|
||||
params['cookies']['__utma'] = '00000000.000#0000000.0000000000.0000000000.0000000000.0'
|
||||
params['cookies']['__utma'] =\
|
||||
'00000000.000#0000000.0000000000.0000000000.0000000000.0'
|
||||
|
||||
return params
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
## Yacy (Web, Images, Videos, Music, Files)
|
||||
#
|
||||
# @website http://yacy.net
|
||||
# @provide-api yes (http://www.yacy-websuche.de/wiki/index.php/Dev:APIyacysearch)
|
||||
# @provide-api yes
|
||||
# (http://www.yacy-websuche.de/wiki/index.php/Dev:APIyacysearch)
|
||||
#
|
||||
# @using-api yes
|
||||
# @results JSON
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
## Yahoo (Web)
|
||||
#
|
||||
# @website https://search.yahoo.com/web
|
||||
# @provide-api yes (https://developer.yahoo.com/boss/search/), $0.80/1000 queries
|
||||
# @provide-api yes (https://developer.yahoo.com/boss/search/),
|
||||
# $0.80/1000 queries
|
||||
#
|
||||
# @using-api no (because pricing)
|
||||
# @results HTML (using search portal)
|
||||
|
|
Loading…
Reference in New Issue