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

« back to all changes in this revision

Viewing changes to recipes/computerworld_pl.recipe

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2012-01-07 11:22:54 UTC
  • mfrom: (29.4.10 precise)
  • Revision ID: package-import@ubuntu.com-20120107112254-n1syr437o46ds802
Tags: 0.8.34+dfsg-1
* New upstream version. (Closes: #654751)
* debian/rules: Do not install calibre copy of chardet; instead, add
  build/binary python-chardet dependency.
* Add disable_plugins.py: Disable plugin dialog. It uses a totally
  non-authenticated and non-trusted way of installing arbitrary code.
  (Closes: #640026)
* debian/rules: Install with POSIX locale, to avoid installing translated
  manpages into the standard locations. (Closes: #646674)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
 
2
 
 
3
from calibre.web.feeds.news import BasicNewsRecipe
 
4
class Computerworld_pl(BasicNewsRecipe):
 
5
    title          = u'Computerworld.pl'
 
6
    __author__        = 'fenuks'
 
7
    description   = u'Serwis o IT w przemyśle, finansach, handlu, administracji oraz rynku IT i telekomunikacyjnym - wiadomości, opinie, analizy, porady prawne'
 
8
    category       = 'IT'
 
9
    language       = 'pl'
 
10
    no_stylesheets=True
 
11
    oldest_article = 7
 
12
    max_articles_per_feed = 100
 
13
    keep_only_tags=[dict(name='div', attrs={'id':'s'})]
 
14
    remove_tags_after=dict(name='div', attrs={'class':'rMobi'})
 
15
    remove_tags=[dict(name='div', attrs={'class':['nnav', 'rMobi']}), dict(name='table', attrs={'class':'ramka_slx'})]
 
16
    feeds          = [(u'Wiadomo\u015bci', u'http://rssout.idg.pl/cw/news_iso.xml')]
 
17
 
 
18
    def get_cover_url(self):
 
19
        soup = self.index_to_soup('http://www.computerworld.pl/')
 
20
        cover=soup.find(name='img', attrs={'class':'prawo'})
 
21
        self.cover_url=cover['src']
 
22
        return getattr(self, 'cover_url', self.cover_url)