From cf8f444e8597bf527ef4bfc691b6d45d5704f77f Mon Sep 17 00:00:00 2001 From: pw3t Date: Sun, 12 Jan 2014 18:31:57 +0100 Subject: [PATCH 1/7] [ehn] Add a 'featured result feature'm putting on top of the reasults ddg definitions and wikipedia (ugly html / css) [ehn] Add a templates for videos, so the thumbnails all have the same side --- searx/engines/vimeo.py | 10 +++++++--- searx/engines/youtube.py | 11 +++++++++-- searx/static/css/style.css | 8 ++++++++ searx/templates/result_templates/videos.html | 7 +++++++ searx/templates/results.html | 15 +++++++++++++++ searx/webapp.py | 8 +++++++- 6 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 searx/templates/result_templates/videos.html diff --git a/searx/engines/vimeo.py b/searx/engines/vimeo.py index 52c89ffdd..35bc3d50a 100644 --- a/searx/engines/vimeo.py +++ b/searx/engines/vimeo.py @@ -35,7 +35,11 @@ def response(resp): for result in dom.xpath(results_xpath): url = base_url + result.xpath(url_xpath)[0] title = p.unescape(extract_text(result.xpath(title_xpath))) - content = ' '.format(url, title, extract_text(result.xpath(content_xpath)[0])) - results.append({'url': url, 'title': title, 'content': content}) - + thumbnail = extract_text(result.xpath(content_xpath)[0]) + content = ' '.format(url, title, thumbnail) + results.append({'url': url + , 'title': title + , 'content': content + , 'template':'videos.html' + , 'thumbnail': thumbnail}) return results diff --git a/searx/engines/youtube.py b/searx/engines/youtube.py index 1331f480e..cefdb6536 100644 --- a/searx/engines/youtube.py +++ b/searx/engines/youtube.py @@ -26,14 +26,21 @@ def response(resp): url = url[:-1] title = result['title']['$t'] content = '' + + thumbnail = '' if len(result['media$group']['media$thumbnail']): - content += ''.format(url, result['media$group']['media$thumbnail'][0]['url']) + thumbnail = result['media$group']['media$thumbnail'][0]['url'] + content += ''.format(url, thumbnail) if len(content): content += '
' + result['content']['$t'] else: content = result['content']['$t'] - results.append({'url': url, 'title': title, 'content': content}) + results.append({'url': url + , 'title': title + , 'content': content + , 'template':'videos.html' + , 'thumbnail':thumbnail}) return results diff --git a/searx/static/css/style.css b/searx/static/css/style.css index 2e6f450e1..90db60d6b 100644 --- a/searx/static/css/style.css +++ b/searx/static/css/style.css @@ -70,6 +70,7 @@ a { text-decoration: none; color: #1a11be; } a:visited { color: #7b11be; } .result { margin: 19px 0 18px 0; padding: 0; max-width: 55em; clear: both; } +.result:hover { background: #e8e7e6; } .result_title { margin-bottom: 0; } .result h3 { font-size: 1em; word-wrap:break-word; margin: 5px 0 1px 0; padding: 0 } .result .content { font-size: 0.8em; margin: 0; padding: 0; max-width: 54em; word-wrap:break-word; line-height: 1.24; } @@ -143,6 +144,13 @@ tr:hover td { background: #DDDDDD; } #result_count { font-size: 0.8em; margin: 2px 0 2px 0; padding: 0 } +#fr { padding: 2px 6px; +display: inline-block; +background: #ECF0F1; +border-radius: 4px; +border: 1px solid #3498DB;; +width:55em;} + #suggestions { position: absolute; left: 54em; width: 12em; margin: 0 2px 5px 5px; padding: 0 2px 2px 2px; } #suggestions span { display: block; font-size: 0.8em; margin: 0 2px 10px 2px; padding: 0; } #suggestions form { display: block; } diff --git a/searx/templates/result_templates/videos.html b/searx/templates/result_templates/videos.html new file mode 100644 index 000000000..97c966e43 --- /dev/null +++ b/searx/templates/result_templates/videos.html @@ -0,0 +1,7 @@ +
+

+

{{ result.title|safe }}

+  {{ result.title }} +

{{ result.url }}

+

+
diff --git a/searx/templates/results.html b/searx/templates/results.html index 4ca36c656..411f84c64 100644 --- a/searx/templates/results.html +++ b/searx/templates/results.html @@ -9,9 +9,24 @@ {% if suggestions %}
Suggestions: {% for suggestion in suggestions %}
{% endfor %}
{% endif %} + +
Number of results: {{ number_of_results }}
+ {% if featured_results %} +
+ + {% for result in featured_results %} + {% if result['template'] %} + {% include 'result_templates/'+result['template'] %} + {% else %} + {% include 'result_templates/default.html' %} + {% endif %} + {% endfor %} +
+ {% endif %} + {% for result in results %} {% if result['template'] %} {% include 'result_templates/'+result['template'] %} diff --git a/searx/webapp.py b/searx/webapp.py index 48448eb25..72395709c 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -125,6 +125,7 @@ def index(): results, suggestions = search(query, request, selected_engines) + featured_results = [] for result in results: if request_data.get('format', 'html') == 'html': if 'content' in result: @@ -139,6 +140,10 @@ def index(): else: result['pretty_url'] = result['url'] + if 'wikipedia' in result['engines'] or 'ddg definitions' in result['engines']: + featured_results.append(result) + results.remove(result) + if request_data.get('format') == 'json': return Response(json.dumps({'query': query, 'results': results}), mimetype='application/json') elif request_data.get('format') == 'csv': @@ -167,7 +172,8 @@ def index(): ,results=results ,q=request_data['q'] ,selected_categories=selected_categories - ,number_of_results=len(results) + ,number_of_results=len(results)+len(featured_results) + ,featured_results=featured_results ,suggestions=suggestions ) From fdb6fac214c2fb5bdc6c27492bc45c6694483fb4 Mon Sep 17 00:00:00 2001 From: pw3t Date: Mon, 13 Jan 2014 22:24:05 +0100 Subject: [PATCH 2/7] [ehn] Add possibility to add icon in results (more ugly html / css, need fix) --- searx/static/img/icon_wikipedia.png | Bin 0 -> 14858 bytes searx/templates/result_templates/default.html | 11 ++++++++++- .../result_templates/featured_results.html | 10 ++++++++++ searx/templates/results.html | 11 +---------- searx/webapp.py | 11 ++++++++--- 5 files changed, 29 insertions(+), 14 deletions(-) create mode 100644 searx/static/img/icon_wikipedia.png create mode 100644 searx/templates/result_templates/featured_results.html diff --git a/searx/static/img/icon_wikipedia.png b/searx/static/img/icon_wikipedia.png new file mode 100644 index 0000000000000000000000000000000000000000..911fa76f62f60c73c8ab85f7a3b80040642e61d5 GIT binary patch literal 14858 zcmW+-1z3|`7at9OYIOHRN*Gcjq+38hrIAuvU^LP&x*Mch8l)SfRJuDSE#3XSej^6Y zGuU?DbIKM)9nucRoe3EX@A`@+TqzL(KYbpUthPSQ&6uz{Nw_Qz1* zcTCgQ3bLT5e;+yR#R(t~BS=YB>YaPWLAyt)L0=rtZN!k1+Clq&D8zbTMO$JJUA`5DG>_7j7QNO#&GNZCC3!6zDWQ=+=Ux(+%=&@4wqB)OO`ZD?PQgE} zzKs}l<@n3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$vH{t3`MXw99zvK2 zdZ0J~U6|khrY&8sh`bAKR&B&=pjeOU$d%s^3b!9W|N7Nk6nbccrbEl$VGsElr6;&T zrl{8@=;K>vqCm9z7cY^rgNpiTCUxgtm(`uqk~QlYKQ!aGM+UiwB1&_ToKE9*LVrk4 z_f@#<OQ>MBsZgprnipGR+%7p(%{_X=o&l91FS=QIH-uD>5VNQ^eoSJN -

{{ result.title|safe }}

+ + {% if result['favicon'] %} +
+ {{result['favicon']}}.png +
+ {% endif %} + +
+

{{ result.title|safe }}


{% if result.content %}{{ result.content|safe }}
{% endif %}

{{ result.pretty_url }}

+
diff --git a/searx/templates/result_templates/featured_results.html b/searx/templates/result_templates/featured_results.html new file mode 100644 index 000000000..4aeddfe24 --- /dev/null +++ b/searx/templates/result_templates/featured_results.html @@ -0,0 +1,10 @@ +
+ {% for result in featured_results %} + + {% if result['template'] %} + {% include 'result_templates/'+result['template'] %} + {% else %} + {% include 'result_templates/default.html' %} + {% endif %} + {% endfor %} +
diff --git a/searx/templates/results.html b/searx/templates/results.html index 411f84c64..b35416ffa 100644 --- a/searx/templates/results.html +++ b/searx/templates/results.html @@ -15,16 +15,7 @@ Number of results: {{ number_of_results }} {% if featured_results %} -
- - {% for result in featured_results %} - {% if result['template'] %} - {% include 'result_templates/'+result['template'] %} - {% else %} - {% include 'result_templates/default.html' %} - {% endif %} - {% endfor %} -
+ {% include 'result_templates/featured_results.html' %} {% endif %} {% for result in results %} diff --git a/searx/webapp.py b/searx/webapp.py index 72395709c..5fc981a89 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -140,9 +140,14 @@ def index(): else: result['pretty_url'] = result['url'] - if 'wikipedia' in result['engines'] or 'ddg definitions' in result['engines']: - featured_results.append(result) - results.remove(result) + for engine in result['engines']: + if engine in ['wikipedia']: + result['favicon'] = engine + featured_results.append(result) + results.remove(result) + elif engine in ['ddg definitions']: + featured_results.append(result) + results.remove(result) if request_data.get('format') == 'json': return Response(json.dumps({'query': query, 'results': results}), mimetype='application/json') From a8ec7fe6a4ad86a8eea4aa6be441984bc5ef7e5a Mon Sep 17 00:00:00 2001 From: pw3t Date: Wed, 15 Jan 2014 22:25:10 +0100 Subject: [PATCH 3/7] [ehn] add favicons for vimeo, soundcloud, twitter and youtube --- searx/engines/mediawiki.py | 8 ++++++++ searx/static/img/icon_soundcloud.png | Bin 0 -> 1150 bytes searx/static/img/icon_twitter.png | Bin 0 -> 1150 bytes searx/static/img/icon_vimeo.png | Bin 0 -> 6518 bytes searx/static/img/icon_youtube.png | Bin 0 -> 1150 bytes searx/templates/result_templates/default.html | 2 +- searx/templates/result_templates/videos.html | 8 ++++++++ searx/webapp.py | 8 +++----- 8 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 searx/static/img/icon_soundcloud.png create mode 100644 searx/static/img/icon_twitter.png create mode 100644 searx/static/img/icon_vimeo.png create mode 100644 searx/static/img/icon_youtube.png diff --git a/searx/engines/mediawiki.py b/searx/engines/mediawiki.py index d4b3fd843..19b4406b5 100644 --- a/searx/engines/mediawiki.py +++ b/searx/engines/mediawiki.py @@ -14,5 +14,13 @@ def request(query, params): def response(resp): search_results = loads(resp.text) res = search_results.get('query', {}).get('search', []) + return [{'url': url + 'wiki/' + quote(result['title'].replace(' ', '_').encode('utf-8')), 'title': result['title']} for result in res[:int(number_of_results)]] + + if not len(res): + return results + for result in res[:int(number_of_results)]: + results.append({'url': url + 'wiki/' + quote(result['title'].replace(' ', '_').encode('utf-8')), 'title': result['title'], 'favicon':'wikipedia'}) + return results + diff --git a/searx/static/img/icon_soundcloud.png b/searx/static/img/icon_soundcloud.png new file mode 100644 index 0000000000000000000000000000000000000000..4130bea1b97673078f1fc9b79fd7c829678b3a19 GIT binary patch literal 1150 zcmb7^O=uHA9K}ac5h{dIp;A9EN&+cHiWIz9pn$P(9u%|L-I>|vo7s)2(Mxvu?c4d!dow$;%L=iKXIq=# zH6aeQ2+<*gNE4P=3F{Qm$G%l7LrmKqS?m#6d?jcSlQG$HtRHCU4Vog>ADH>dA{$`E zPSU3%6m=<*?HaW@z08=bp>?+=ib&#z?DEiRaj8pT-TD;7n6|_R6yp1QbPjpgd)C9I z{Z$MWTqH*vY(M5;$9N^=xPxtntMs~v4@hRiG1`YDu0K?`@mOK*ou>Mjd&~AC4?ija z8jlAhh4w)&$}4n?NX)#_n0g}d;=Q7JREepX|L4tkYY(^(qvjbj)=+bIByK*HnE$A# z9@Vs&cmAFK!xxRtgZ2FSqY~?mcsO&{$HJn*?O7l5pCoS0didFp&);*=d)~2ryMFHf z#?u;!Qxb`j9=7DF7@zjA@L6H{IrG)}{3Wg_apD(!uJzmfXFfGS@*2r=lK4pGT=W#H z$V^o5jO%$_*0}#tvgX)6<4NVY_xAk*T^EB0jjp0Xx+sw@_()%HBdVbmJlkhHCR592 zE(4ay02zzM=1Ypm1{C{s7Z+ oIK)0n6KXQULNNCiZ?q7ji~Ki?k<}z-{}c7ga^7wr?C&Z426T_eApigX literal 0 HcmV?d00001 diff --git a/searx/static/img/icon_twitter.png b/searx/static/img/icon_twitter.png new file mode 100644 index 0000000000000000000000000000000000000000..b4a71699a727c7642612dfa116c748df3c530fe1 GIT binary patch literal 1150 zcmd5)O-lk%6un{KMi>_n?QH2z|AEpUs8vFnq*c3Gwi4VWK~P9g#F)@V5VDO#m`Wj1 zi6iuZF_nfwAvhW{l=i{vUUYJrrd$QR;mo~r?>*-o-Wz}ce5_W$_bAK`0t^Fy9f2jR zbm|xYu%};)G5ANYpck74Bbb{J{XCj*#{Sw6yiXUtu!>fR54lA4 zHxysAN(TX8VhETN?Lj%6j=#4XuHQ7e+FZMypOP~Zhgv@6j|r#P)iCrxe7TzR)b|{s zo~wS72F}r$7-?9PGhaxGak4sZ6qRee>dpf4>0kNuQHi@wj#q#YkM5It&HKEw zvi;RVDGcl(%E?Mi7}N4|k@4L-f%j@_lpk$43b`P#!WuBr&uqC<$yHmqQs8H_v+ADO z8s${K$u7?qQ$D|{Pqm-s_58p820X(Kni$hAfR+uQ$pMtj9i+Q4YXT@CSgFVP0GFBa AX8-^I literal 0 HcmV?d00001 diff --git a/searx/static/img/icon_vimeo.png b/searx/static/img/icon_vimeo.png new file mode 100644 index 0000000000000000000000000000000000000000..4fe4336daf5ccc254f20c869e8ed95a6691027c6 GIT binary patch literal 6518 zcmeHL%We}f6djP*vtUiKp)HNrv17v)1Z)u>fcOC51KocJo6?a?Z%cjLfJQ4UwBJNsPR^)u&3Q>(#@xFZavYFi*W&T7vCLwe)EiJFWXW zakYKXxbf&j_OqR4Xzj+6Y<1??P`Pa{O1(G2WrGF?T-K!vHes>IE&wy529X z2Y=Ajn6SRJcq8{q|KJVSbfa%A!#HLSUDOHc1&z5w4h-ZFJ#aDZFg^0@*8h|91Kaw& z(y8C^LEG;8;D4Lro-CW^qyxMH$PV^+24E+1F;YjSeEaM zj2YSb-;5dajhHsJ!4g~l7c$3r`Y&R|V$`OOZWDVqT}W8rDdWgb))50 z&-oKMbX>eV4rLObdhm%cF%TEmF=t%Lq!<5MU;Ckr&mqLEeOL@RPVt*AT($Qo{_J$p zZ1e3z_W8l_oHrXw;pRNYWBrjol{;+ABYJ+_+B*!5xeIx0J+SY?*|Wk|;K%#Z`I1w{ zBPTK!Ok5)#^qtlR9X1&6beh@v{3V0m+k1aLACE(@>Daw7JwNNuF9q?6CaaGP4~{SR z3mzvYhF~q=&BtZ_Tkmcag$(4ViPhONIS*p5YSm)!9MON+>spYy>oooEmmpwdf_hk) zIc|9nPKAFNYu-ISdfzxE_WHwzG_aPr1k{g?Aq7n>Mt=`H!`Y1#n>UH!iNDS_*7{6Z^CoM$!(nz1F?lYV)7gKBhaZb6MJ&XO{V!low#UF81OE>LzW~o~MkW9N literal 0 HcmV?d00001 diff --git a/searx/static/img/icon_youtube.png b/searx/static/img/icon_youtube.png new file mode 100644 index 0000000000000000000000000000000000000000..977887dbbb8407afcc5c1a9c42109560826fd1a7 GIT binary patch literal 1150 zcmd7Rze@sP7zglI=*Qhzc5100Qe%q{^bhneL~GE{($>;H5CqpyK|^7Q4Vps{I7vg0 z1`S5HR0u&hpSXxFaUgvAo_FY-5|NYd@p<3(p6B}vH=GbYKB_9XFNvKAAtFMEWnzgH zyUs(bu^0B+toLzP((I{BS<)Tg`I}Ey?tu3xDR8C{Mx@Ds3!UI~j!9_~(#-xqeK2Ru zUNwlhzHl^yO63*n8;6)y_Sj2%`mSt4p1bZ4+!o?FRIAmlqvJcM^Sk`MlqcilIeW{x zS0sLeTCLVoD(OhBoDAixIYliDi6#m#45O!BuOoH&F_g1siycKRvey?&6wzw6y4vkF z(wQ%WV)vemlkX_OhX%ndw)hCsG|_B+V{7}(({tzS*|M$#%gpqt(I@2c29m2Up1M2Z m+;xBOStE={^M@)jg?6m~ literal 0 HcmV?d00001 diff --git a/searx/templates/result_templates/default.html b/searx/templates/result_templates/default.html index 3f2d0f360..14f527361 100644 --- a/searx/templates/result_templates/default.html +++ b/searx/templates/result_templates/default.html @@ -2,7 +2,7 @@ {% if result['favicon'] %}
- {{result['favicon']}}.png + {{result['favicon']}}.png
{% endif %} diff --git a/searx/templates/result_templates/videos.html b/searx/templates/result_templates/videos.html index 97c966e43..524c99116 100644 --- a/searx/templates/result_templates/videos.html +++ b/searx/templates/result_templates/videos.html @@ -1,4 +1,12 @@
+ + {% if result['favicon'] %} +
+ {{result['favicon']}}.png +
+ {% endif %} + +

{{ result.title|safe }}

 {{ result.title }} diff --git a/searx/webapp.py b/searx/webapp.py index 5fc981a89..b26e868f5 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -141,11 +141,9 @@ def index(): result['pretty_url'] = result['url'] for engine in result['engines']: - if engine in ['wikipedia']: - result['favicon'] = engine - featured_results.append(result) - results.remove(result) - elif engine in ['ddg definitions']: + if engine in ['wikipedia', 'youtube', 'vimeo', 'soundcloud', 'twitter']: + result['favicon'] = engine + if engine in ['wikipedia', 'ddg definitions']: featured_results.append(result) results.remove(result) From d43bd05582c189d8696d58e22c160399ed0b811d Mon Sep 17 00:00:00 2001 From: pw3t Date: Sun, 12 Jan 2014 18:31:57 +0100 Subject: [PATCH 4/7] [ehn] Add a 'featured result feature'm putting on top of the reasults ddg definitions and wikipedia (ugly html / css) [ehn] Add a templates for videos, so the thumbnails all have the same side --- searx/templates/result_templates/videos.html | 4 +--- searx/webapp.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/searx/templates/result_templates/videos.html b/searx/templates/result_templates/videos.html index 524c99116..ae6d8f16c 100644 --- a/searx/templates/result_templates/videos.html +++ b/searx/templates/result_templates/videos.html @@ -1,12 +1,10 @@
- {% if result['favicon'] %}
- {{result['favicon']}}.png + {{result['favicon']}}.ico
{% endif %} -

{{ result.title|safe }}

 {{ result.title }} diff --git a/searx/webapp.py b/searx/webapp.py index b26e868f5..43bef7db9 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -141,7 +141,7 @@ def index(): result['pretty_url'] = result['url'] for engine in result['engines']: - if engine in ['wikipedia', 'youtube', 'vimeo', 'soundcloud', 'twitter']: + if engine in ['wikipedia', 'youtube', 'vimeo', 'soundcloud', 'twitter', 'stackoverflow']: result['favicon'] = engine if engine in ['wikipedia', 'ddg definitions']: featured_results.append(result) From 91057682b5f813200ffd887fcb0747aa344dfa0e Mon Sep 17 00:00:00 2001 From: pw3t Date: Mon, 13 Jan 2014 22:24:05 +0100 Subject: [PATCH 5/7] [ehn] Add possibility to add icon in results (more ugly html / css, need fix) --- searx/templates/result_templates/default.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/searx/templates/result_templates/default.html b/searx/templates/result_templates/default.html index 14f527361..ab6d469b4 100644 --- a/searx/templates/result_templates/default.html +++ b/searx/templates/result_templates/default.html @@ -2,7 +2,7 @@ {% if result['favicon'] %}
- {{result['favicon']}}.png + {{result['favicon']}}.ico
{% endif %} From dd1baa6d5894c814625cdf19e71b797ab6354d9c Mon Sep 17 00:00:00 2001 From: pw3t Date: Thu, 16 Jan 2014 21:58:18 +0100 Subject: [PATCH 6/7] [fix] replace the png icons by ico's, minor chnage in the html --- searx/static/img/icon_github.ico | Bin 0 -> 6518 bytes .../{icon_soundcloud.png => icon_soundcloud.ico} | Bin searx/static/img/icon_stackoverflow.ico | Bin 0 -> 1150 bytes .../img/{icon_twitter.png => icon_twitter.ico} | Bin .../img/{icon_vimeo.png => icon_vimeo.ico} | Bin .../{icon_wikipedia.png => icon_wikipedia.ico} | Bin .../img/{icon_youtube.png => icon_youtube.ico} | Bin searx/webapp.py | 2 +- 8 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 searx/static/img/icon_github.ico rename searx/static/img/{icon_soundcloud.png => icon_soundcloud.ico} (100%) create mode 100644 searx/static/img/icon_stackoverflow.ico rename searx/static/img/{icon_twitter.png => icon_twitter.ico} (100%) rename searx/static/img/{icon_vimeo.png => icon_vimeo.ico} (100%) rename searx/static/img/{icon_wikipedia.png => icon_wikipedia.ico} (100%) rename searx/static/img/{icon_youtube.png => icon_youtube.ico} (100%) diff --git a/searx/static/img/icon_github.ico b/searx/static/img/icon_github.ico new file mode 100644 index 0000000000000000000000000000000000000000..133f0ca35428bf551b9e37376997c1b681f44cad GIT binary patch literal 6518 zcmeH~KWrRD6vp>1XB|TKf7ixoz@b1XKnf)MM_{F(LQo?`fG`NCCGT zi=t9gj#{mVelFTQ6-C!YQ8YJ~jgu(4AKz|#q>$0|(?t>fVZU}eelCvVFB*+T$8wv^ zX1m=^KEnT$`SSWCNnVTNWP^5!_)eEIJ3W2XrW*V&JAco_zXI+zgsw(UrTbr<*cs#K zbdnEz5ZyNvo0@80U$55>G#bqnIIguEo@HOF)k^h^gJ*eFaq{*w>&;Ef^QBVhRJmN< zq@9K5Hp5q|)p>j;4QoBM-Vnz#Zzaj}CfE(8>0+(czSD4FU$3|C;5mLaJT<&Y``(Qo z2r=Q9=eW=1{{Y`vjhTbr$t{QZIpZ>zKZFsMb}qvo&&kbop>;gNp98<1+2@(dUAX|~ zr2cEb{FPzWSy%7KR?~ZOsktT^^Oi5H-jj_xozCkSs78OKBha{{v2rZm-Z4B&@@WlH z!!4w}L~M<9_MMvM2;adaP|&LsdD- z1#^%*?T_vLO03Dp;QPg|S@vmohWGdt^SNM8!tpo>=^pJR4l(qN;u${nTxMU6zG1{A z&LOgCI6KEy4a=GM8FTq8x{tu~JV{p!;t8MMIMg#2tKuGn&HS_Etr?E}{`8RizHpI# zR>K;A**?%eg9^|0xoK0!Ckly^wm>Z}Fo*Zz3eUG5L#G+)^B?$f(mF8hd1afG}!mNxOXZR~sI z`Wqy+tkV%?eOg6ap4)6`6Z_i6zUTcs&HR*rCQSXzDZ-euxIksp< zATDv{=p1DaEQfxLIr|^|xAeu8ry*_5%O~< z{tuTG3)ihUjL-Md^xV{Q*vDn_-VS6rRd^Q2Innher`b>6@{L|mlTGY&7CWI_aOpi= z99wyl!(Ll9m^K{8d@f`5NAf-`{a^26!)#$PY~TLIcT8HLepbWY?Pv|F#p2>ddvBh$ z`H1iTFKWoN_nS^pPYpMczixGp+lxz_MVeu(duGOmz+T#}zObynL*bqXwTi~wxrmqH yx;Sbb%0+kia-X@V4)%5e-vW1*CBNTP6METxOqP_R+#;??Y%&9r8JNs~X5er7V8d(x literal 0 HcmV?d00001 diff --git a/searx/static/img/icon_soundcloud.png b/searx/static/img/icon_soundcloud.ico similarity index 100% rename from searx/static/img/icon_soundcloud.png rename to searx/static/img/icon_soundcloud.ico diff --git a/searx/static/img/icon_stackoverflow.ico b/searx/static/img/icon_stackoverflow.ico new file mode 100644 index 0000000000000000000000000000000000000000..b2242bc6cb1943b1954bf72b3875091bc9aa9f29 GIT binary patch literal 1150 zcmZQzU<5(|0R|wcz>vYhz#zuJz@P!dKp~(AL>x$gfiO1%0|+C7oSfYMDmJtL@lGJV2gLvFE7t#aEMNQIsciLsm-3Z%F!kuPZN&yH$BMQ8Vc4mB z^&8i+l?R;5SGQVMZw}FFJ{lz2dnXcIAB+#QhtsKIO|eVasz4yt2I}De$w~CwLnfddDnNa0tkd3nW}Eu@KM=oWnen=rx96pRdhSyn{p2Tq^irNQV$;tu?JXxz z{Z**Gmu%Bs*8ug3gVbuLKQRO9`=OHt#xB_OgT#P(bAY&xb=qrDm>S)bCrY}hPo4tx z{s-a+m^d-CUh)%uozy3%p?a%{(F0Qh)XN0aw-%~*AxxYY8t7M$-pNqC2Y@s?y1oWR y28IU45Bul;WMG)U3BmJ$Vh?~S!MK@$;UAFy0fZG97=9f7|NnnG5c31YffxX05k>?6 literal 0 HcmV?d00001 diff --git a/searx/static/img/icon_twitter.png b/searx/static/img/icon_twitter.ico similarity index 100% rename from searx/static/img/icon_twitter.png rename to searx/static/img/icon_twitter.ico diff --git a/searx/static/img/icon_vimeo.png b/searx/static/img/icon_vimeo.ico similarity index 100% rename from searx/static/img/icon_vimeo.png rename to searx/static/img/icon_vimeo.ico diff --git a/searx/static/img/icon_wikipedia.png b/searx/static/img/icon_wikipedia.ico similarity index 100% rename from searx/static/img/icon_wikipedia.png rename to searx/static/img/icon_wikipedia.ico diff --git a/searx/static/img/icon_youtube.png b/searx/static/img/icon_youtube.ico similarity index 100% rename from searx/static/img/icon_youtube.png rename to searx/static/img/icon_youtube.ico diff --git a/searx/webapp.py b/searx/webapp.py index 43bef7db9..6bd4e6097 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -141,7 +141,7 @@ def index(): result['pretty_url'] = result['url'] for engine in result['engines']: - if engine in ['wikipedia', 'youtube', 'vimeo', 'soundcloud', 'twitter', 'stackoverflow']: + if engine in ['wikipedia', 'youtube', 'vimeo', 'soundcloud', 'twitter', 'stackoverflow', 'github']: result['favicon'] = engine if engine in ['wikipedia', 'ddg definitions']: featured_results.append(result) From 380b440a55ba3b8ec1430843226fa6b4b0dfe289 Mon Sep 17 00:00:00 2001 From: pw3t Date: Thu, 16 Jan 2014 21:58:18 +0100 Subject: [PATCH 7/7] [fix] replace the png icons by ico's, minor chnage in the html --- searx/engines/mediawiki.py | 6 ------ searx/static/css/style.css | 7 ------- searx/templates/result_templates/featured_results.html | 10 ---------- searx/templates/results.html | 3 --- searx/webapp.py | 3 --- 5 files changed, 29 deletions(-) delete mode 100644 searx/templates/result_templates/featured_results.html diff --git a/searx/engines/mediawiki.py b/searx/engines/mediawiki.py index 19b4406b5..00ad0f106 100644 --- a/searx/engines/mediawiki.py +++ b/searx/engines/mediawiki.py @@ -18,9 +18,3 @@ def response(resp): return [{'url': url + 'wiki/' + quote(result['title'].replace(' ', '_').encode('utf-8')), 'title': result['title']} for result in res[:int(number_of_results)]] - if not len(res): - return results - for result in res[:int(number_of_results)]: - results.append({'url': url + 'wiki/' + quote(result['title'].replace(' ', '_').encode('utf-8')), 'title': result['title'], 'favicon':'wikipedia'}) - return results - diff --git a/searx/static/css/style.css b/searx/static/css/style.css index 868f2f813..83d281806 100644 --- a/searx/static/css/style.css +++ b/searx/static/css/style.css @@ -151,13 +151,6 @@ tr:hover td { background: #DDDDDD; } #result_count { font-size: 0.8em; margin: 2px 0 2px 0; padding: 0 } -#fr { padding: 2px 6px; -display: inline-block; -background: #ECF0F1; -border-radius: 4px; -border: 1px solid #3498DB;; -width:55em;} - #suggestions { position: absolute; left: 54em; width: 12em; margin: 0 2px 5px 5px; padding: 0 2px 2px 2px; } #suggestions span { display: block; font-size: 0.8em; margin: 0 2px 10px 2px; padding: 0; } #suggestions form { display: block; } diff --git a/searx/templates/result_templates/featured_results.html b/searx/templates/result_templates/featured_results.html deleted file mode 100644 index 4aeddfe24..000000000 --- a/searx/templates/result_templates/featured_results.html +++ /dev/null @@ -1,10 +0,0 @@ -
- {% for result in featured_results %} - - {% if result['template'] %} - {% include 'result_templates/'+result['template'] %} - {% else %} - {% include 'result_templates/default.html' %} - {% endif %} - {% endfor %} -
diff --git a/searx/templates/results.html b/searx/templates/results.html index b35416ffa..be40900c3 100644 --- a/searx/templates/results.html +++ b/searx/templates/results.html @@ -14,9 +14,6 @@
Number of results: {{ number_of_results }}
- {% if featured_results %} - {% include 'result_templates/featured_results.html' %} - {% endif %} {% for result in results %} {% if result['template'] %} diff --git a/searx/webapp.py b/searx/webapp.py index bc534d36b..07db95452 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -144,9 +144,6 @@ def index(): for engine in result['engines']: if engine in ['wikipedia', 'youtube', 'vimeo', 'soundcloud', 'twitter', 'stackoverflow', 'github']: result['favicon'] = engine - if engine in ['wikipedia', 'ddg definitions']: - featured_results.append(result) - results.remove(result) if request_data.get('format') == 'json': return Response(json.dumps({'query': query, 'results': results}), mimetype='application/json')