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

  1. # -*- coding: utf-8 -*-
  2.  
  3. from calibre.web.feeds.news import BasicNewsRecipe
  4.  
  5. class Haber7TS (BasicNewsRecipe):
  6.  
  7.     title               = u'H7 T├£MSPOR'
  8.     __author__            = u'thomass'
  9.     description            =  ' Haber 7 T├£MSPOR sitesinden t├╝m bran┼ƒlarda spor haberleri '
  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,spor,futbol'
  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              = '  #newsheadcon h1{font-weight: bold; font-size: 18px;color:#0000FF} '
  28.     keep_only_tags    = [dict(name='div', attrs={'class':['intNews','leftmidmerge']})]
  29.     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']})]
  30.     cover_img_url = 'http://image.tumspor.com/v2/images/tasarim/images/logo.jpg'
  31.     masthead_url = 'http://image.tumspor.com/v2/images/tasarim/images/logo.jpg'
  32.     remove_empty_feeds= True
  33.  
  34.     feeds          = [
  35.                       ( u'Futbol', u'http://open.dapper.net/services/h7tsfutbol'),
  36.                       ( u'Basketbol', u'http://open.dapper.net/services/h7tsbasket'),
  37.                       ( u'Tenis', u'http://open.dapper.net/services/h7tstenis'),
  38.                       ( u'NBA', u'http://open.dapper.net/services/h7tsnba'),
  39.                       ( u'Di─ƒer Sporlar', u'http://open.dapper.net/services/h7tsdiger'),
  40.                       ( u'Yazarlar & Magazin', u'http://open.dapper.net/services/h7tsyazarmagazin'),
  41.                         ]
  42.     def preprocess_html(self, soup):
  43.          for alink in soup.findAll('a'):
  44.             if alink.string is not None:
  45.                tstr = alink.string
  46.                alink.replaceWith(tstr)
  47.          return soup
  48.    # def print_version(self, url):
  49.     # return url.replace('http://www.aksiyon.com.tr/aksiyon/newsDetail_getNewsById.action?load=detay&', 'http://www.aksiyon.com.tr/aksiyon/mobile_detailn.action?')
  50.  
  51.