Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 06-17-2012, 03:02 PM   #1
rainbowwarrior
Junior Member
rainbowwarrior began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jun 2012
Device: kindle
New recipe - Homopedia.pl

Here's a simple recipe for new articles of Homopedia. (In Polish)
Code:
class AdvancedUserRecipe1325420346(BasicNewsRecipe):
    title                 = u'Homopedia'
    oldest_article        = 7
    max_articles_per_feed = 100
    publication_type        = 'newspaper'
    masthead_url            = 'http://a5.sphotos.ak.fbcdn.net/hphotos-ak-snc6/67335_168352243178437_166186720061656_594975_5800720_n.jpg'
    encoding                = 'utf-8'
    auto_cleanup_keep = '//*[@class="important"]'
    
    def get_cover_url(self):
        return 'http://a7.sphotos.ak.fbcdn.net/hphotos-ak-snc4/65568_166186970061631_166186720061656_580324_7584264_n.jpg'

    feeds          = [(u'Nowe has\u0142a', u'http://www.homopedia.pl/w/index.php?title=Specjalna:Nowe_strony&feed=atom&hideliu=&hidepatrolled=&hidebots=&hideredirs=1&limit=50&namespace=0'), (u'Blog', u'http://blog.homopedia.pl/feeds/posts/default')]

    def get_article_url(self, article):
        artl  = article.get('link',  None)
        rest, sep, article_id  = artl.rpartition('/')
        return 'http://www.homopedia.pl/w/index.php?redirect=no&printable=yes&title=' + article_id

    remove_tags    = [dict(name='div', attrs={'class':'noprint'}),dict(name='ul', attrs={'class':'noprint'}),dict(name='ul', attrs={'id':'footer-places'}),dict(name='li', attrs={'id':'footer-info-viewcount'}),dict(name='span', attrs={'class':'editsection'}),dict(name='div', attrs={'id':'jump-to-nav'})]

    remove_tags_before = dict(dict(name = 'h2', attrs = {'class' : 'post-title'}))
    remove_tags_after = dict(dict(name = 'a', attrs = {'class' : 'timestamp-link'}))

    extra_css = 'p{text-indent:1.5em!important;padding:0!important;margin;0!important}'
rainbowwarrior is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Recipe works when mocked up as Python file, fails when converted to Recipe ode Recipes 7 09-04-2011 04:57 AM
Need Help with Recipe UtahJames Recipes 1 04-12-2011 09:50 AM
recipe please Torx Recipes 0 01-22-2011 12:18 PM
new recipe marbs Recipes 0 11-24-2010 04:59 AM
Recipe Help hellonewman Calibre 1 01-23-2010 03:45 AM


All times are GMT -4. The time now is 02:27 AM.


MobileRead.com is a privately owned, operated and funded community.