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 02-09-2011, 09:23 PM   #1
adrnalin
Junior Member
adrnalin began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2010
Device: Sony PRS-600
New Recipe: The Jakarta Post

Hi all,

I made a new recipe, this time is The Jakarta Post. The largest English newspaper in Indonesia. I hope you like it

Code:
#!/usr/bin/env  python
__license__   = 'GPL v3'
__copyright__ = '2011, Adrian Gunawan <agunawan at adrnalin.com>'
__author__    = 'Adrian Gunawan'
__version__   = 'v1.0'
__date__      = '02 February 2011'

'''
http://www.thejakartapost.com/
'''

from calibre.web.feeds.news import BasicNewsRecipe

class JakartaPost(BasicNewsRecipe):
    title          = u'Jakarta Post'
    masthead_url   = 'http://www.thejakartapost.com/images/jakartapost_logo.jpg'
    cover_url      = 'http://www.thejakartapost.com/images/jakartapost_logo.jpg'

    __author__     = u'Adrian Gunawan'
    description    = u'Indonesian Newspaper in English from Jakarta Post Online Edition'
    category       = 'breaking news, national, business, international, Indonesia'
    language       = 'id'
    oldest_article = 2
    max_articles_per_feed = 100

    no_stylesheets        = True
    use_embedded_content  = False
    no_javascript         = True
    remove_empty_feeds    = True

    timefmt               = ' [%A, %d %B, %Y]'
    encoding              = 'utf-8'

    keep_only_tags = [dict(name='div', attrs ={'id':'news-main'})]

    extra_css = '''
                  h1{font-family:Georgia,"Times New Roman",Times,serif; font-weight:bold; font-size:large;}
                  .cT-storyDetails{font-family:Arial,Helvetica,sans-serif; color:#666666;font-size:x-small;}
                  .articleBody{font-family:Arial,Helvetica,sans-serif; color:black;font-size:small;}
                  .cT-imageLandscape{font-family:Arial,Helvetica,sans-serif; color:#333333 ;font-size:x-small;}
                  .source{font-family:Arial,Helvetica,sans-serif; color:#333333 ;font-size:xx-small;}
                  #content{font-family:Arial,Helvetica,sans-serif;font-size:x-small;}
                  .pageprint{font-family:Arial,Helvetica,sans-serif;font-size:small;}
                  #bylineDetails{font-family:Arial,Helvetica,sans-serif; color:#666666;font-size:x-small;}
                  .featurePic-wide{font-family:Arial,Helvetica,sans-serif;font-size:x-small;}
                  #idfeaturepic{font-family:Arial,Helvetica,sans-serif;font-size:x-small;}
                  h3{font-family:Georgia,"Times New Roman",Times,serif; font-size:small;}
                  h2{font-family:Georgia,"Times New Roman",Times,serif; font-size:small;}
                  h4{font-family:Georgia,"Times New Roman",Times,serif; font-size:small;}
                  h5{font-family:Georgia,"Times New Roman",Times,serif; font-size:small;}
                  body{font-family:Arial,Helvetica,sans-serif; font-size:x-small;}
                '''

    remove_tags     = [
                        dict(name='div', attrs ={'class':['text-size']}),
                       ]

    feeds          = [

                      (u'Breaking News', u'http://www.thejakartapost.com/breaking/feed'),
                      (u'National', u'http://www.thejakartapost.com/channel/national/feed'),
                      (u'Archipelago', u'http://www.thejakartapost.com/channel/archipelago/feed'),
                      (u'Business', u'http://www.thejakartapost.com/channel/business/feed'),
                      (u'Jakarta', u'http://www.thejakartapost.com/channel/jakarta/feed'),
                      (u'World', u'http://www.thejakartapost.com/channel/world/feed'),
                      (u'Sports', u'http://www.thejakartapost.com/channel/sports/feed'),
                      ]
adrnalin 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
Hello .. How should I post a recipe? jimolo Introduce Yourself 6 12-23-2010 06:02 PM
Recipe for St Louis Post Dispatch cisaak Recipes 0 12-07-2010 09:07 PM
Recipe for St. Louis Post-Dispatch cisaak Calibre 1 12-06-2010 11:02 PM
hello from jakarta okasama Introduce Yourself 9 06-08-2010 09:50 AM
Recipe for Washington Post blog oski24601 Calibre 1 11-25-2009 05:22 PM


All times are GMT -4. The time now is 01:55 PM.


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