~ubuntu-branches/debian/wheezy/calibre/wheezy

« back to all changes in this revision

Viewing changes to recipes/chicago_tribune.recipe

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2012-02-10 07:35:00 UTC
  • mfrom: (29.4.12 precise)
  • Revision ID: package-import@ubuntu.com-20120210073500-jxakntd7c94wh7rs
Tags: 0.8.38+dfsg-1
* New upstream release.
* debian/control: Bump Standards-Version to 3.9.2. No changes necessary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
 
78
78
 
79
79
    def get_article_url(self, article):
80
 
        print article.get('feedburner_origlink', article.get('guid', article.get('link')))
81
 
        return article.get('feedburner_origlink', article.get('guid', article.get('link')))
 
80
        url = article.get('feedburner_origlink', article.get('guid', article.get('link')))
 
81
        if url.endswith('?track=rss'):
 
82
            url = url.partition('?')[0]
 
83
        return url
 
84
 
 
85
    def skip_ad_pages(self, soup):
 
86
        text = soup.find(text='click here to continue to article')
 
87
        if text:
 
88
            a = text.parent
 
89
            url = a.get('href')
 
90
            if url:
 
91
                return self.index_to_soup(url, raw=True)
82
92
 
83
93
    def postprocess_html(self, soup, first_fetch):
84
94
        # Remove the navigation bar. It was kept until now to be able to follow