diff --git a/resources/recipes/instapaper.recipe b/resources/recipes/instapaper.recipe index ba74faf7ae..73c32d08a7 100644 --- a/resources/recipes/instapaper.recipe +++ b/resources/recipes/instapaper.recipe @@ -1,11 +1,10 @@ -#!/usr/bin/env python - __license__ = 'GPL v3' -__copyright__ = '2009, Darko Miletic ' +__copyright__ = '2009-2010, Darko Miletic ' ''' www.instapaper.com ''' +import urllib from calibre import strftime from calibre.web.feeds.news import BasicNewsRecipe @@ -22,18 +21,15 @@ class Instapaper(BasicNewsRecipe): max_articles_per_feed = 100 no_stylesheets = True use_embedded_content = False - remove_javascript = True needs_subscription = True INDEX = u'http://www.instapaper.com' LOGIN = INDEX + u'/user/login' - html2lrf_options = [ - '--comment', description - , '--category', category - , '--publisher', publisher - ] - - html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"\noverride_css=" p {text-indent: 0em; margin-top: 0em; margin-bottom: 0.5em} img {margin-top: 0em; margin-bottom: 0.4em}"' + conversion_options = { + 'comment' : description + , 'tags' : category + , 'publisher' : publisher + } feeds = [ (u'Unread articles' , INDEX + u'/u' ) @@ -63,7 +59,7 @@ class Instapaper(BasicNewsRecipe): description = self.tag_to_string(item.div) atag = item.a if atag and atag.has_key('href'): - url = self.INDEX + atag['href'] + '/text' + url = atag['href'] title = self.tag_to_string(atag) date = strftime(self.timefmt) articles.append({ @@ -75,3 +71,6 @@ class Instapaper(BasicNewsRecipe): totalfeeds.append((feedtitle, articles)) return totalfeeds + def print_version(self, url): + return self.INDEX + '/text?u=' + urllib.quote(url) + diff --git a/resources/recipes/new_york_review_of_books.recipe b/resources/recipes/new_york_review_of_books.recipe index f7b3fedbec..bd18b95c43 100644 --- a/resources/recipes/new_york_review_of_books.recipe +++ b/resources/recipes/new_york_review_of_books.recipe @@ -23,7 +23,7 @@ class NewYorkReviewOfBooks(BasicNewsRecipe): no_javascript = True needs_subscription = True - keep_only_tags = [dict(id='article-body')] + keep_only_tags = [dict(id=['article-body','page-title'])] remove_tags = [dict(attrs={'class':['article-tools', 'article-links', 'center advertisement']})] diff --git a/resources/recipes/new_york_review_of_books_no_sub.recipe b/resources/recipes/new_york_review_of_books_no_sub.recipe index c851cf7b2f..e462689403 100644 --- a/resources/recipes/new_york_review_of_books_no_sub.recipe +++ b/resources/recipes/new_york_review_of_books_no_sub.recipe @@ -21,7 +21,7 @@ class NewYorkReviewOfBooks(BasicNewsRecipe): no_stylesheets = True no_javascript = True - keep_only_tags = [dict(id='article-body')] + keep_only_tags = [dict(id=['article-body', 'page-title'])] remove_tags = [dict(attrs={'class':['article-tools', 'article-links', 'center advertisement']})]