home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Narzedzia / Calibre / calibre-0.8.18.msi / file_280 / mmc_rtv.recipe < prev    next >
Encoding:
Text File  |  2011-09-09  |  2.2 KB  |  58 lines

  1. __license__ = 'GPL v3'
  2. __copyright__ = '2010, BlonG'
  3. '''
  4. www.rtvslo.si
  5. '''
  6. from calibre.web.feeds.news import BasicNewsRecipe
  7.  
  8. class MMCRTV(BasicNewsRecipe):
  9.     title = u'MMC RTV Slovenija'
  10.     __author__ = u'BlonG'
  11.     description = u"Prvi interaktivni multimedijski portal, MMC RTV Slovenija"
  12.     oldest_article = 3
  13.     max_articles_per_feed = 20
  14.     language = 'sl'
  15.     no_stylesheets = True
  16.     use_embedded_content = False
  17.  
  18.     cover_url = 'https://sites.google.com/site/javno2010/home/rtv_slo_cover.jpg'
  19.  
  20.     extra_css = '''
  21.             h1{font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:large;}
  22.             h2{font-family:Arial,Helvetica,sans-serif; font-weight:normal;font-size:small;}
  23.             p{font-family:Arial,Helvetica,sans-serif;font-size:small;}
  24.             body{font-family:Helvetica,Arial,sans-serif;font-size:small;}
  25.             '''
  26.  
  27.     def print_version(self, url):
  28.             split_url = url.split("/")
  29.             print_url = 'http://www.rtvslo.si/index.php?c_mod=news&op=print&id=' + split_url[-1]
  30.             return print_url
  31.  
  32.     keep_only_tags = [
  33.             dict(name='div', attrs={'class':'title'}),
  34.             dict(name='div', attrs={'id':'newsbody'}),
  35.             dict(name='div', attrs={'id':'newsblocks'}),
  36.             ]
  37. #    remove_tags=[
  38. # 40            dict(name='div', attrs={'id':'newsblocks'}),
  39. #            ]
  40.  
  41.     feeds = [
  42.             (u'Slovenija', u'http://www.rtvslo.si/feeds/01.xml'),
  43.             (u'Svet', u'http://www.rtvslo.si/feeds/02.xml'),
  44.             (u'Evropska unija', u'http://www.rtvslo.si/feeds/16.xml'),
  45.             (u'Gospodarstvo', u'http://www.rtvslo.si/feeds/04.xml'),
  46.             (u'\u010crna kronika', u'http://www.rtvslo.si/feeds/08.xml'),
  47.             (u'Okolje', u'http://www.rtvslo.si/feeds/12.xml'),
  48.             (u'Znanost in tehnologija', u'http://www.rtvslo.si/feeds/09.xml'),
  49.             (u'Zabava', u'http://www.rtvslo.si/feeds/06.xml'),
  50.             (u'Ture avanture', u'http://www.rtvslo.si/feeds/28.xml'),
  51.             ]
  52.  
  53. #    def preprocess_html(self, soup):
  54. #            newsblocks = soup.find('div',attrs = ['id':'newsblocks'])
  55. #            soup.find('div', attrs = {'id':'newsbody'}).insert(-1, newsblocks)
  56. #            return soup
  57.  
  58.