diff options
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 |