~ubuntu-branches/ubuntu/karmic/calibre/karmic

« back to all changes in this revision

Viewing changes to src/calibre/web/feeds/recipes/recipe_newsweek.py

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-30 12:49:41 UTC
  • mfrom: (1.3.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090730124941-qjdsmri25zt8zocn
Tags: 0.6.3+dfsg-0ubuntu1
* New upstream release. Please see http://calibre.kovidgoyal.net/new_in_6/
  for the list of new features and changes.
* remove_postinstall.patch: Update for new version.
* build_debug.patch: Does not apply any more, disable for now. Might not be
  necessary any more.
* debian/copyright: Fix reference to versionless GPL.
* debian/rules: Drop obsolete dh_desktop call.
* debian/rules: Add workaround for weird Python 2.6 setuptools behaviour of
  putting compiled .so files into src/calibre/plugins/calibre/plugins
  instead of src/calibre/plugins.
* debian/rules: Drop hal fdi moving, new upstream version does not use hal
  any more. Drop hal dependency, too.
* debian/rules: Install udev rules into /lib/udev/rules.d.
* Add debian/calibre.preinst: Remove unmodified
  /etc/udev/rules.d/95-calibre.rules on upgrade.
* debian/control: Bump Python dependencies to 2.6, since upstream needs
  it now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
class Newsweek(BasicNewsRecipe):
10
10
 
11
11
    title          = 'Newsweek'
12
 
    __author__     = 'Kovid Goyal'
 
12
    __author__     = 'Kovid Goyal and Sujata Raman'
13
13
    description    = 'Weekly news and current affairs in the US'
14
14
    no_stylesheets = True
 
15
 
 
16
    extra_css      = '''
 
17
                        h1{color:#383733;font-family:Arial,Helvetica,sans-serif;font-size:large;}
 
18
                        .deck{font-family:Georgia,"Century Schoolbook","Times New Roman",Times,serif;color:#383733;font-size:small;}
 
19
                        .articleInfo{color:#474537;font-family:Arial,Helvetica,sans-serif; font-size:xx-small;}
 
20
                        .authorName{color:#B61900;font-family:Arial,Helvetica,sans-serif;font-size:medium;}
 
21
                        .authorInfo{color:#0066CC;font-family:Arial,Helvetica,sans-serif;font-size:xx-small;}
 
22
                        .articleUpdated{ font-size:xx-small; color:#73726C; font-family:Arial,Helvetica,sans-serif;}
 
23
                        .issueDate{font-family :Arial,Helvetica,sans-serif;font-size:xx-small;font-style:italic;}
 
24
                        .story{color:#333333; font-family:Georgia,"Century Schoolbook","Times New Roman",Times,serif;font-size:small;}
 
25
                        .photoCredit{color:#999999;font-family:Arial,Helvetica,sans-serif;font-size:xx-small;}
 
26
                        .photoCaption{color:#0A0A09;font-family:Arial,Helvetica,sans-serif;font-size:xx-small;font-weight:bold;}'''
 
27
 
15
28
    encoding       = 'utf-8'
16
29
    language = _('English')
17
30
    remove_tags = [
18
 
            {'class':['navbar', 'ad', 'sponsorLinksArticle', 'mm-content',
 
31
            {'class':['fwArticle noHr','fwArticle','subinfo','hdlBulletItem','head-content','navbar','link', 'ad', 'sponsorLinksArticle', 'mm-content',
19
32
                'inline-social-links-wrapper', 'email-article',
 
33
                'inlineComponentRight',
20
34
                'comments-and-social-links-wrapper', 'EmailArticleBlock']},
21
35
            {'id' : ['footer', 'ticker-data', 'topTenVertical',
22
36
                'digg-top-five', 'mesothorax', 'nw-comments',
24
38
            {'class': re.compile('related-cloud')},
25
39
            ]
26
40
    keep_only_tags = [{'class':['article HorizontalHeader', 'articlecontent']}]
27
 
 
28
 
 
29
41
    recursions = 1
30
42
    match_regexps = [r'http://www.newsweek.com/id/\S+/page/\d+']
31
43
 
109
121
 
110
122
    def get_cover_url(self):
111
123
        cover_url = None
112
 
        soup = self.index_to_soup(self.INDEX)
 
124
        soup = self.index_to_soup('http://www.newsweek.com')
113
125
        link_item = soup.find('div',attrs={'class':'cover-image'})
114
126
        if link_item and link_item.a and link_item.a.img:
115
127
           cover_url = link_item.a.img['src']