diff options
author | asciimoo <asciimoo@gmail.com> | 2013-11-09 18:39:20 +0100 |
---|---|---|
committer | asciimoo <asciimoo@gmail.com> | 2013-11-09 18:39:20 +0100 |
commit | 17bf00ee42583910e45794e1438a2bab459225ad (patch) | |
tree | f1fc78646676c40c39cda1de9b69cf5dc39ff263 /searx/engines/twitter.py | |
parent | 14a53e343085083d0ddf271adff2d13ca1c94f99 (diff) | |
download | searxng-17bf00ee42583910e45794e1438a2bab459225ad.tar.gz searxng-17bf00ee42583910e45794e1438a2bab459225ad.zip |
[enh] removing result html tags
Diffstat (limited to 'searx/engines/twitter.py')
-rw-r--r-- | searx/engines/twitter.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/searx/engines/twitter.py b/searx/engines/twitter.py index d0a0aef17..f9d9e26ad 100644 --- a/searx/engines/twitter.py +++ b/searx/engines/twitter.py @@ -1,6 +1,7 @@ from urlparse import urljoin from urllib import urlencode from lxml import html +from cgi import escape categories = ['social media'] @@ -21,6 +22,6 @@ def response(resp): link = tweet.xpath('.//small[@class="time"]//a')[0] url = urljoin(base_url, link.attrib.get('href')) title = ''.join(tweet.xpath('.//span[@class="username js-action-profile-name"]//text()')) - content = ''.join(map(html.tostring, tweet.xpath('.//p[@class="js-tweet-text tweet-text"]//*'))) + content = escape(''.join(tweet.xpath('.//p[@class="js-tweet-text tweet-text"]//text()'))) results.append({'url': url, 'title': title, 'content': content}) return results |