diff --git a/recipes/al_monitor.recipe b/recipes/al_monitor.recipe
index 0067f9ed2f..99b1ca2c76 100644
--- a/recipes/al_monitor.recipe
+++ b/recipes/al_monitor.recipe
@@ -1,6 +1,6 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
-from __future__ import print_function
+from __future__ import print_function, unicode_literals
__license__ = 'GPL v3'
__copyright__ = '2014, spswerling'
'''
@@ -162,7 +162,7 @@ class AlMonitor(BasicNewsRecipe):
def scrape_article_date(self, soup):
for span in soup.findAll('span'):
txt = self.text(span)
- rgx = re.compile(unicode(r'Posted ([a-zA-Z]+ \d\d?, \d\d\d\d).*'))
+ rgx = re.compile(r'Posted ([a-zA-Z]+ \d\d?, \d\d\d\d).*')
hit = rgx.match(txt)
if hit:
return self.date_from_string(txt)
diff --git a/recipes/ambito_financiero.recipe b/recipes/ambito_financiero.recipe
index 5718401e8f..e7605163b7 100644
--- a/recipes/ambito_financiero.recipe
+++ b/recipes/ambito_financiero.recipe
@@ -126,7 +126,7 @@ class Ambito_Financiero(BasicNewsRecipe):
cfind = smallsoup.find('div', id="contenido_data")
if cfind:
p.append(cfind)
- return unicode(soup)
+ return type(u'')(soup)
return raw_html
def cleanup(self):
diff --git a/recipes/american_thinker.recipe b/recipes/american_thinker.recipe
index ef022451c5..2917f2f322 100644
--- a/recipes/american_thinker.recipe
+++ b/recipes/american_thinker.recipe
@@ -34,7 +34,7 @@ class AmericanThinker(BasicNewsRecipe):
namespaceHTMLElements=False)
for x in root.xpath('''descendant-or-self::*[@class and contains(concat(' ', normalize-space(@class), ' '), ' article_body ') and (@class and contains(concat(' ', normalize-space(@class), ' '), ' bottom '))]'''): # noqa
x.getparent().remove(x)
- return etree.tostring(root, encoding=unicode)
+ return etree.tostring(root, encoding='unicode')
feeds = [(u'http://feeds.feedburner.com/americanthinker'),
(u'http://feeds.feedburner.com/AmericanThinkerBlog')
diff --git a/recipes/apple_daily.recipe b/recipes/apple_daily.recipe
index ebf7c33330..eaf284ab0e 100644
--- a/recipes/apple_daily.recipe
+++ b/recipes/apple_daily.recipe
@@ -161,7 +161,7 @@ class AppleDaily(BasicNewsRecipe):
article_titles.append(force_unicode(a.title, 'utf-8'))
mi.comments = self.description
- if not isinstance(mi.comments, unicode):
+ if not isinstance(mi.comments, type(u'')):
mi.comments = mi.comments.decode('utf-8', 'replace')
mi.comments += ('\n\n' + _('Articles in this issue: ') + '\n' +
'\n\n'.join(article_titles))
@@ -272,7 +272,7 @@ class AppleDaily(BasicNewsRecipe):
elem = BeautifulSoup(translatedTempl).find('div')
body.insert(len(body.contents), elem)
with open(last, 'wb') as fi:
- fi.write(unicode(soup).encode('utf-8'))
+ fi.write(type(u'')(soup).encode('utf-8'))
if len(feeds) == 0:
raise Exception('All feeds are empty, aborting.')
diff --git a/recipes/appledaily_tw.recipe b/recipes/appledaily_tw.recipe
index 700ee4c7f1..6964ed0191 100644
--- a/recipes/appledaily_tw.recipe
+++ b/recipes/appledaily_tw.recipe
@@ -104,7 +104,7 @@ class AppledailyTW(BasicNewsRecipe):
]
def preprocess_raw_html(self, raw_html, url):
- raw_html = re.sub(unicode(r' ]*?>Uprzejmie prosimy o przestrzeganie netykiety.+?www\.gravatar\.com
.*?<\/a>'), '', raw_html)
raw_html = re.sub(
- unicode(r'
]*?>Uprzejmie prosimy o przestrzeganie netykiety.+?www\\.gravatar\\.com\\.
', re.DOTALL), lambda match: ''), (re.compile(u']*?>.{,2}
', re.DOTALL), lambda match: '')] ignore_duplicate_articles = {'title', 'url'} diff --git a/recipes/cnetjapan.recipe b/recipes/cnetjapan.recipe index fa4494fc99..20d12fa56d 100644 --- a/recipes/cnetjapan.recipe +++ b/recipes/cnetjapan.recipe @@ -16,11 +16,11 @@ class CNetJapan(BasicNewsRecipe): remove_javascript = True preprocess_regexps = [ - (re.compile(unicode(r'.*