From 17bf00ee42583910e45794e1438a2bab459225ad Mon Sep 17 00:00:00 2001 From: asciimoo Date: Sat, 9 Nov 2013 18:39:20 +0100 Subject: [enh] removing result html tags --- searx/engines/twitter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'searx/engines/twitter.py') 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 -- cgit v1.2.3