Fix #4240 (Can't get goole reader recipe to work)

This commit is contained in:
Kovid Goyal 2009-12-17 10:31:29 -07:00
parent 1d0784f7c7
commit 611231ea59
2 changed files with 3 additions and 2 deletions

View File

@ -32,6 +32,6 @@ class GoogleReader(BasicNewsRecipe):
soup = self.index_to_soup('http://www.google.com/reader/api/0/tag/list')
for id in soup.findAll(True, attrs={'name':['id']}):
url = id.contents[0]
feeds.append((re.search('/([^/]*)$', url).group(1),
feeds.append((re.search('/([^/]*)$', url).group(1),
self.base_url + urllib.quote(url.encode('utf-8')) + self.get_options))
return feeds

View File

@ -194,7 +194,8 @@ class RecursiveFetcher(object):
purl[i] = quote(purl[i])
url = urlparse.urlunparse(purl)
try:
with closing(self.browser.open_novisit(url, timeout=self.timeout)) as f:
open_func = getattr(self.browser, 'open_novisit', self.browser.open)
with closing(open_func(url, timeout=self.timeout)) as f:
data = response(f.read()+f.read())
data.newurl = f.geturl()
except urllib2.URLError, err: