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

  1. #!/usr/bin/env  python
  2. __license__ = 'GPL 3'
  3. __copyright__ = 'zotzo'
  4. __docformat__ = 'restructuredtext en'
  5.  
  6. from calibre.web.feeds.news import BasicNewsRecipe
  7.  
  8.  
  9. class CreditSlips(BasicNewsRecipe):
  10.     language = 'en'
  11.     __author__ = 'zotzot'
  12.     version = 2
  13.     title = u'Credit Slips.org'
  14.     publisher = u'Bankr-L'
  15.     category = u'Economic blog'
  16.     description = u'A discussion on credit and bankruptcy'
  17.     cover_url = 'http://bit.ly/eAKNCB'
  18.     oldest_article = 15
  19.     max_articles_per_feed = 100
  20.     use_embedded_content = True
  21.     no_stylesheets = True
  22.     remove_javascript = True
  23.  
  24.     conversion_options =   {
  25.                                'comments': description,
  26.                                'tags': category,
  27.                                'language': 'en',
  28.                                'publisher': publisher,
  29.                            }
  30.  
  31.     feeds = [
  32.                (u'Credit Slips', u'http://www.creditslips.org/creditslips/atom.xml')
  33.            ]
  34.  
  35.     extra_css =    '''
  36.                        .author {font-family:Helvetica,sans-serif; font-weight:normal;font-size:small;}
  37.                        h1      {font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:large;}
  38.                        p       {font-family:Helvetica,Arial,sans-serif;font-size:small;}
  39.                        body    {font-family:Helvetica,Arial,sans-serif;font-size:small;}
  40.                    '''
  41.  
  42.     def populate_article_metadata(self, article, soup, first):
  43.        h2 = soup.find('h2')
  44.        h2.replaceWith(h2.prettify() + '<p><em>Posted by ' + article.author + '</em></p>')
  45.