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 08-16-2013, 02:44 PM   #1
buzzlightyear
Junior Member
buzzlightyear began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Aug 2013
Device: Kindle 5
Recipe for News24 (South Africa)

I've put together a recipe for News24, a popular South African news portal. The builtin IOL recipe was used as a sample and starting point, so if any credit is needed thank you to the author of that recipe.

Spoiler:

Code:
class AdvancedUserRecipe1375900744(BasicNewsRecipe):
    title          = u'News24'
    description           = "News24."
    __author__  = 'Nicki de Wet'
    publisher             = 'Media24'
    category              = 'news, politics, South Africa'
    oldest_article        = 3
    max_articles_per_feed = 20
    no_stylesheets        = True
    encoding              = 'utf8'
    use_embedded_content  = False
    auto_cleanup          = False    
    language              = 'en_ZA'
    remove_empty_feeds    = True
    publication_type      = 'newsportal'
    masthead_url          = 'http://www.24.com/images/widgethead_news.png'
    extra_css             = """ 
                                body{font-family: Arial,Helvetica,sans-serif }
                                img{display: block}
                            """

    conversion_options = {
                          'comment'   : description
                        , 'tags'      : category
                        , 'publisher' : publisher
                        , 'language'  : language
                        }

    remove_tags = [dict(name=['object','embed','iframe','table','meta','link']),
					dict(attrs={'class':['TwitterfacebookLink','superSportArticleBlock', 'videoHighlights', 'facebookComments','share', 'item_block','kalahari_product left', 'block red', 'credit']}),
					dict(attrs={'id':['comments_wrap', 'article_toolbox_bot', 'inside_news','sponsored-links', 'lnkGalleries', 'relatedlinks_box', 'lnkUserGalleries', 'lnkNewsGalleries', 'relatedlinks', 'divRelatedLinks']})]
					
    keep_only_tags = [dict(attrs={'class':['left col633', 'article col626', 'columnWrapperLeft', 'articlecolumn', 'article_img', 'picture_caption', 'DiveTable']})]

    feeds          = [(u'Top Stories', u'http://feeds.news24.com/articles/news24/TopStories/rss'), (u'South Africa', u'http://feeds.news24.com/articles/news24/SouthAfrica/rss'), (u'World', u'http://feeds.news24.com/articles/news24/World/rss'), (u'Sport', u'http://feeds.24.com/articles/sport/featured/topstories/rss')]
buzzlightyear is offline   Reply With Quote
Old 08-16-2013, 02:46 PM   #2
buzzlightyear
Junior Member
buzzlightyear began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Aug 2013
Device: Kindle 5
I forgot to add, please feel free to add this into calibre.
buzzlightyear is offline   Reply With Quote
Advert
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hi from South Africa samthurgood Introduce Yourself 17 10-01-2010 08:07 AM
Hi from South Africa kessi Introduce Yourself 8 01-30-2010 12:49 AM
Hello from South Africa giuliano176 Introduce Yourself 8 06-30-2009 04:06 PM
Hello from South Africa Eliab Introduce Yourself 6 05-26-2009 05:53 AM


All times are GMT -4. The time now is 07:36 AM.


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