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

  1. # -*- coding: utf-8 -*-
  2.  
  3. from calibre.web.feeds.news import BasicNewsRecipe
  4.  
  5. class Haber7 (BasicNewsRecipe):
  6.  
  7.     title               = u'Haber 7'
  8.     __author__            = u'thomass'
  9.     description            =  ' Haber 7 sitesinden haberler '
  10.     oldest_article         =2
  11.     max_articles_per_feed  =100
  12.     no_stylesheets         = True
  13.     #delay                  = 1
  14.     #use_embedded_content   = False
  15.     encoding               = 'ISO 8859-9'
  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              = 'body{ font-size: 12px}h2{font-weight: bold; font-size: 18px;color:#0000FF} #newsheadcon h1{font-weight: bold; font-size: 18px;color:#0000FF}'
  28.  
  29.     keep_only_tags    = [dict(name='div', attrs={'class':['intNews','leftmidmerge']})]
  30.     remove_tags  = [dict(name='div', attrs={'id':['blocktitle','banner46860body']}),dict(name='div', attrs={'class':[ 'Breadcrumb','shr','mobile/home.jpg','etiket','yorumYazNew','shr','y-list','banner','lftBannerShowcase','comments','interNews','lftBanner','midblock','rightblock','comnum','commentcon',]}) ,dict(name='a', attrs={'class':['saveto','sendto','comlink','newsshare',]}),dict(name='iframe', attrs={'name':['frm111','frm107']}) ,dict(name='ul', attrs={'class':['nocPagi','leftmidmerge']})]
  31.  
  32.     cover_img_url = 'http://dl.dropbox.com/u/39726752/haber7.JPG'
  33.     masthead_url = 'http://dl.dropbox.com/u/39726752/haber7.JPG'
  34.     remove_empty_feeds= True
  35.  
  36.     feeds          = [
  37.                      ( u'Siyaset', u'http://open.dapper.net/services/h7siyaset'),
  38.                       ( u'G├╝ncel', u'http://open.dapper.net/services/h7guncel'),
  39.                       ( u'Ya┼ƒam', u'http://open.dapper.net/services/h7yasam'),
  40.                       ( u'Ekonomi', u'http://open.dapper.net/services/h7ekonomi'),
  41.                       ( u'3. Sayfa', u'http://open.dapper.net/services/h73sayfa'),
  42.                       ( u'D├╝nya', u'http://open.dapper.net/services/h7dunya'),
  43.                       ( u'Medya', u'http://open.dapper.net/services/h7medya'),
  44.  
  45.                       ( u'Yazarlar', u'http://open.dapper.net/services/h7yazarlar'),
  46.                       ( u'Bilim', u'http://open.dapper.net/services/h7bilim'),
  47.                       ( u'E─ƒitim', u'http://open.dapper.net/services/h7egitim'),
  48.                       ( u'Spor', u'http://open.dapper.net/services/h7sporv3'),
  49.  
  50.  
  51.                         ]
  52.     def preprocess_html(self, soup):
  53.          for alink in soup.findAll('a'):
  54.             if alink.string is not None:
  55.                tstr = alink.string
  56.                alink.replaceWith(tstr)
  57.          return soup
  58.    # def print_version(self, url):
  59.     # return url.replace('http://www.aksiyon.com.tr/aksiyon/newsDetail_getNewsById.action?load=detay&', 'http://www.aksiyon.com.tr/aksiyon/mobile_detailn.action?')
  60.  
  61.