Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 11-22-2008, 06:48 AM   #1
mccande
Member
mccande began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Oct 2008
Device: PRS-505
Request for recipes

This is a great program.

My early attempts at writing recipes in Python were not a great success.

Could anyone help with a recipe for the following publications

http://www.timesonline.co.uk/tol/news/

and

http://thescotsman.scotsman.com/

Both have RSS feeds

Thanks
mccande is offline   Reply With Quote
Old 11-22-2008, 10:25 AM   #2
kiklop74
Guru
kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.
 
kiklop74's Avatar
 
Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
Quote:
Originally Posted by mccande View Post
This is a great program.

My early attempts at writing recipes in Python were not a great success.

Could anyone help with a recipe for the following publications

http://www.timesonline.co.uk/tol/news/
Here goes:

Code:
#!/usr/bin/env  python

__license__   = 'GPL v3'
__copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
'''
timesonline.co.uk
'''

from calibre.web.feeds.news import BasicNewsRecipe

class Timesonline(BasicNewsRecipe):
    title                 = u'The Times Online'
    __author__            = 'Darko Miletic'
    description           = 'UK news'    
    oldest_article        = 7
    max_articles_per_feed = 100
    no_stylesheets        = True
    use_embedded_content  = False
    simultaneous_downloads = 1

    remove_tags_after  = dict(name='div', attrs={'class':'bg-666'})
    remove_tags = [
                     dict(name='div'  , attrs={'class':'hide-from-print padding-bottom-7' })
                  ]

    feeds          = [
                        (u'Top stories from Times Online', u'http://www.timesonline.co.uk/tol/feeds/rss/topstories.xml'     )
                     ]

    def print_version(self, url):
        main, split, rest = url.partition('#')
        return main + '?print=yes'

Quote:
Originally Posted by mccande View Post
Code:
#!/usr/bin/env  python

__license__   = 'GPL v3'
__copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
'''
thescotsman.scotsman.com
'''

from calibre.web.feeds.news import BasicNewsRecipe

class Thescotsman(BasicNewsRecipe):
    title                 = u'The Scotsman'
    __author__            = 'Darko Miletic'
    description           = 'News from Scotland'    
    oldest_article        = 7
    max_articles_per_feed = 100
    no_stylesheets        = True
    use_embedded_content  = False
    simultaneous_downloads = 1

    keep_only_tags = [dict(name='div', attrs={'id':'viewarticle'})]
    remove_tags = [
                     dict(name='div'  , attrs={'class':'viewarticlepanel' })
                  ]

    feeds          = [
                        (u'Latest National News', u'http://thescotsman.scotsman.com/getFeed.aspx?Format=rss&sectionid=4068')
                     ]
kiklop74 is offline   Reply With Quote
Advert
Old 11-23-2008, 07:46 AM   #3
mccande
Member
mccande began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Oct 2008
Device: PRS-505
Thanks a lot. You make it look so easy.
mccande is offline   Reply With Quote
Old 11-23-2008, 10:57 AM   #4
kiklop74
Guru
kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.
 
kiklop74's Avatar
 
Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
Quote:
Originally Posted by mccande View Post
Thanks a lot. You make it look so easy.
It is not that hard to write a recipe once you get a hold of it. You just need firefox + firebug extension + decent text editor and some patience.
kiklop74 is offline   Reply With Quote
Old 12-26-2008, 01:05 AM   #5
Ronald
Junior Member
Ronald began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Dec 2008
Device: ILiad
Hello everyone. Could someone please create a recipe for the newsfeeds of allafrica.com, (explicit; Top News, Southern Africa, Guinea and South Africa)?
http://allafrica.com/tools/headlines/rss.html
The recipe should be able to fetch the print versions of the articles. I tried so much to get it on the last weeks, but I am a totally noob and have no idea about calibre or python.
It would be very nice, if someone else could do this for me.

Greetings,
Ronald
Ronald is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Request for recipes of sites with no rss PipSqueak Recipes 1 10-16-2010 10:05 PM
Where my recipes are kept? bthoven Calibre 6 02-26-2010 12:20 AM
Help with RSS recipes fmma Calibre 1 06-15-2009 11:51 AM
Request for Recipes GPThomson Calibre 2 11-21-2008 12:19 PM
Request for Recipes girlperson1 Calibre 4 11-12-2008 03:25 PM


All times are GMT -4. The time now is 12:06 AM.


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