~stub/ubuntu/precise/calibre/devel

« back to all changes in this revision

Viewing changes to resources/recipes/oregonian.recipe

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-04-12 11:29:25 UTC
  • mfrom: (42.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110412112925-c7171kt2bb5rmft4
Tags: 0.7.50+dfsg-2
* debian/control: Build with libpodofo-dev to enable PDF metadata.
  (Closes: #619632)
* debian/control: Add libboost1.42-dev build dependency. Apparently it is
  needed in some setups. (Closes: #619807)
* debian/rules: Call dh_sip to generate a proper sip API dependency, to
  prevent crashes like #616372 for partial upgrades.
* debian/control: Bump python-qt4 dependency to >= 4.8.3-2, which reportedly
  fixes crashes on startup. (Closes: #619701, #620125)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from __future__ import with_statement
 
2
__license__ = 'GPL 3'
 
3
__copyright__ = 'zotzot'
 
4
__docformat__ = 'restructuredtext en'
 
5
 
 
6
from calibre.web.feeds.news import BasicNewsRecipe
 
7
 
 
8
 
 
9
class Oregonian(BasicNewsRecipe):
 
10
    title = u'The Oregonian'
 
11
    oldest_article = 2
 
12
    max_articles_per_feed = 100
 
13
    language = 'en'
 
14
    __author__ = 'Zotzot'
 
15
    description = 'Portland, Oregon local newspaper'
 
16
    publisher = 'Advance Publications'
 
17
    category = 'news, Portland'
 
18
    cover_url = 'http://bit.ly/gUgxGd'
 
19
    no_stylesheets = True
 
20
    masthead_url = 'http://bit.ly/eocL70'
 
21
    remove_tags = [dict(name='div', attrs={'class':['footer', 'content']})]
 
22
    use_embedded_content = False
 
23
    remove_tags_before = dict(id='article')
 
24
    remove_tags_after = dict(id='article')
 
25
    feeds = [
 
26
#(u'Timbers', u'feed://blog.oregonlive.com/timbers_impact/atom.xml'),
 
27
(u'News', u'http://blog.oregonlive.com/news_impact/atom.xml'),
 
28
(u'Opinion', u'http://blog.oregonlive.com/opinion_impact/atom.xml'),
 
29
(u'Living', u'http://blog.oregonlive.com/living_impact/atom.xml'),
 
30
(u'Sports', u'http://blog.oregonlive.com/sports_impact/atom.xml'),
 
31
(u'Business', u'http://blog.oregonlive.com/business_impact/atom.xml')]
 
32
 
 
33
    extra_css = '''
 
34
                    h1{font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:large;}
 
35
                    h2{font-family:Arial,Helvetica,sans-serif; font-weight:normal;font-size:small;}
 
36
                    p{font-family:Arial,Helvetica,sans-serif;font-size:small;}
 
37
                    body{font-family:Helvetica,Arial,sans-serif;font-size:small;}
 
38
'''
 
39
 
 
40
 
 
41
def get_article_url(self, article):
 
42
        url = BasicNewsRecipe.get_article_url(self, article)
 
43
        if '/video/' not in url:
 
44
            return url