summaryrefslogtreecommitdiff
path: root/searx/utils.py
diff options
context:
space:
mode:
authorThomas Pointhuber <thomas.pointhuber@gmx.at>2014-10-26 19:11:28 +0100
committerThomas Pointhuber <thomas.pointhuber@gmx.at>2014-10-26 19:11:28 +0100
commit0e1035eac1a3359edb44c998abc7f76d6f7ad985 (patch)
tree3ef91532383f713324239a6797f0219da129236f /searx/utils.py
parentc36c935b03cc87ddfcac5ce3ded333be73387a7a (diff)
parent79f1676e318d36704687966fd124b7f29ddc21fa (diff)
downloadsearxng-0e1035eac1a3359edb44c998abc7f76d6f7ad985.tar.gz
searxng-0e1035eac1a3359edb44c998abc7f76d6f7ad985.zip
Merge https://github.com/asciimoo/searx into template_oscar
Conflicts: searx/translations/de/LC_MESSAGES/messages.po searx/translations/en/LC_MESSAGES/messages.po searx/translations/es/LC_MESSAGES/messages.po searx/translations/fr/LC_MESSAGES/messages.po searx/translations/hu/LC_MESSAGES/messages.po searx/translations/it/LC_MESSAGES/messages.po searx/translations/nl/LC_MESSAGES/messages.po searx/webapp.py
Diffstat (limited to 'searx/utils.py')
-rw-r--r--searx/utils.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/searx/utils.py b/searx/utils.py
index a9ece355a..7764291fc 100644
--- a/searx/utils.py
+++ b/searx/utils.py
@@ -1,4 +1,4 @@
-#import htmlentitydefs
+# import htmlentitydefs
from codecs import getincrementalencoder
from HTMLParser import HTMLParser
from random import choice
@@ -20,6 +20,10 @@ def gen_useragent():
return ua.format(os=choice(ua_os), version=choice(ua_versions))
+def searx_useragent():
+ return 'searx'
+
+
def highlight_content(content, query):
if not content:
@@ -64,8 +68,8 @@ class HTMLTextExtractor(HTMLParser):
self.result.append(unichr(codepoint))
def handle_entityref(self, name):
- #codepoint = htmlentitydefs.name2codepoint[name]
- #self.result.append(unichr(codepoint))
+ # codepoint = htmlentitydefs.name2codepoint[name]
+ # self.result.append(unichr(codepoint))
self.result.append(name)
def get_text(self):