Fix #6018 (Updated recipe for The Old New Thing blog) and fix regression in metadata download that could cause errors with some books

This commit is contained in:
Kovid Goyal 2010-06-28 11:22:53 -06:00
parent a4fc6f3b18
commit 8525faf60c
2 changed files with 4 additions and 2 deletions

View File

@ -28,7 +28,7 @@ class OldNewThing(BasicNewsRecipe):
}
remove_attributes = ['width','height']
keep_only_tags = [dict(attrs={'class':['postsub','comment']})]
keep_only_tags = [dict(attrs={'class':'full-post'})]
remove_tags = [dict(attrs={'class':['post-attributes','post-tags','post-actions']})]
feeds = [(u'Posts', u'http://blogs.msdn.com/oldnewthing/rss.xml')]

View File

@ -313,6 +313,8 @@ def search(title=None, author=None, publisher=None, isbn=None, isbndb_key=None,
def sort_func(x, y):
def cleanup_title(s):
if s is None:
s = _('Unknown')
s = s.strip().lower()
s = prefix_pat.sub(' ', s)
s = trailing_paren_pat.sub('', s)