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

  1. # -*- coding: utf-8 -*-
  2.  
  3. from calibre.web.feeds.news import BasicNewsRecipe
  4.  
  5. class Star (BasicNewsRecipe):
  6.  
  7.     title               = u'Star Gazetesi'
  8.     __author__            = u'thomass'
  9.     description            =  'yeni T├╝rkiye''nin Gazetesi'
  10.     oldest_article         =2
  11.     max_articles_per_feed  =100
  12.     no_stylesheets         = True
  13.     #delay                  = 1
  14.     #use_embedded_content   = False
  15.     encoding               = 'utf-8'
  16.     publisher              = 'thomass'
  17.     category               = 'g├╝ncel, haber, t├╝rk├ºe'
  18.     language               = 'tr'
  19.     publication_type = 'newspaper'
  20.  
  21.     conversion_options = {
  22.                             'tags'            : category
  23.                             ,'language'        : language
  24.                             ,'publisher'       : publisher
  25.                             ,'linearize_tables': True
  26.                          }
  27.     extra_css              = '  .font8{font-weight: bold; font-size:20px}.font11{font-weight: normal; font-size:small}#hdetay{ font-family:sans-serif;font-size: 9px }' #.story-feature{display: block; padding: 0; border: 1px solid; width: 40%; font-size: small} .story-feature h2{text-align: center; text-transform: uppercase} '
  28.     
  29.    #extra_css              = ' body{ font-family: Verdana,Helvetica,Arial,sans-serif } .introduction{font-weight: bold} .story-feature{display: block; padding: 0; border: 1px solid; width: 40%; font-size: small} .story-feature h2{text-align: center; text-transform: uppercase} '
  30.     keep_only_tags    = [dict(name='div', attrs={'class':['font8']}),dict(name='span', attrs={'class':['font11']}),dict(name='div', attrs={'id':['hdetay']})]#,,dict(name='h6', attrs={'class':['KirmiziText']}) dict(name='div', attrs={'id':['Haber']}),dict(name='div', attrs={'id':['gallery']})]
  31.     #remove_tags  = [dict(name='img', attrs={'src':[ 'http://medya.aksiyon.com.tr/aksiyon/images/logo/logo.bmp','/aksiyon/images/template/green/baslik0.gif','mobile/home.jpg']}) ],dict(name='h1', attrs={'class':['H1-Haber-DetayBasligi']}),dict(name='h4', attrs={'class':['BrownText']}) ,
  32.  
  33.     cover_img_url = 'http://www.stargazete.com/starnew/img/starlogo.png'
  34.     masthead_url = 'http://www.stargazete.com/starnew/img/starlogo.png'
  35.     remove_empty_feeds= True
  36.     #remove_attributes = ['width','height']
  37.  
  38.     feeds          = [
  39.                      
  40.                       
  41.                       ( u'MANSET', u'http://open.dapper.net/services/starmanset'),
  42.                       ( u'G├£NCEL', u'http://www.stargazete.com/guncel.xml'),
  43.                       ( u'POL─░T─░KA', u'http://www.stargazete.com/politika.xml'),
  44.                       ( u' EKONOM─░', u'http://www.stargazete.com/ekonomi.xml'),
  45.                       ( u'D├£NYA', u'http://www.stargazete.com/dunya.xml'),
  46.                       ( u'YAZARLAR', u'http://www.stargazete.com/gazeteyazarlar.xml'),
  47.                       ( u'SPOR', u'http://www.stargazete.com/spor.xml'),
  48.                       ( u'SPOR YAZARLARI', u'http://www.stargazete.com/index.php?metot=rss&islem=sporyazarlar'),
  49.                       ( u'S─░NEMA', u'http://www.stargazete.com/sinema.xml'),
  50.                       ( u'KADIN&SA─₧LIK', u'http://www.stargazete.com/kadinsaglik.xml'),
  51.                       ( u' STARTEK', u'http://www.stargazete.com/startek.xml'),
  52.                       ( u' A├çIK G├ûR├£┼₧', u'http://www.stargazete.com/acikgorus.xml'),
  53.                       ( u'Star PAZAR', u'http://www.stargazete.com/pazar.xml'),
  54.                       ( u'Star CUMARTES─░', u'http://www.stargazete.com/cumartesi.xml'),
  55.                   
  56.  
  57.  
  58.                         ]
  59.     def preprocess_html(self, soup):#remove links
  60.          for alink in soup.findAll('a'):
  61.             if alink.string is not None:
  62.                tstr = alink.string
  63.                alink.replaceWith(tstr)
  64.          return soup
  65.     #def print_version(self, url):
  66.      #return url.replace('/', 'http://www.stargazete.com/')
  67.  
  68.