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

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

Notices

Closed Thread
 
Thread Tools Search this Thread
Old 12-19-2008, 03:51 AM   #61
carpii
Enthusiast
carpii began at the beginning.
 
Posts: 38
Karma: 16
Join Date: Nov 2008
Device: Iliad or Sony
Quote:
Originally Posted by kiklop74 View Post
Here goes:
Thanks so much for Linux Magazine, kiklop
carpii is offline  
Old 12-19-2008, 01:02 PM   #62
DougBarry
Junior Member
DougBarry began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Dec 2008
Device: PRS-700BC
I'm interested in a recipe for the Utne Reader: http://www.utne.com/

Thanks.
DougBarry is offline  
Old 12-20-2008, 07:59 AM   #63
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: 780
Karma: 194642
Join Date: Dec 2007
Location: Argentina
Device: Kindle PaperWhite, Motorola Xoom
Quote:
Originally Posted by DougBarry View Post
I'm interested in a recipe for the Utne Reader: http://www.utne.com/

Thanks.
Here goes:
Attached Files
File Type: zip utne.zip (3.3 KB, 406 views)
kiklop74 is offline  
Old 12-20-2008, 11:08 AM   #64
ashadocat
Member
ashadocat began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Dec 2008
Device: sony 505
Can comics be done? because everyday decay is almost the perfect size for the reader and a good comic. do I need to do that thing with dosage?
ashadocat is offline  
Old 12-20-2008, 04:01 PM   #65
girlperson1
Member
girlperson1 began at the beginning.
 
Posts: 21
Karma: 34
Join Date: Nov 2008
Device: Sony 505
Recipe Request for Science Daily

http://www.sciencedaily.com/newsfeeds.htm

The RSS feeds are located here: http://www.sciencedaily.com/newsfeed.xml

It's updated six times a day!!!
girlperson1 is offline  
Old 12-20-2008, 06:12 PM   #66
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: 780
Karma: 194642
Join Date: Dec 2007
Location: Argentina
Device: Kindle PaperWhite, Motorola Xoom
Quote:
Originally Posted by girlperson1 View Post
http://www.sciencedaily.com/newsfeeds.htm

The RSS feeds are located here: http://www.sciencedaily.com/newsfeed.xml

It's updated six times a day!!!
here goes:
Attached Files
File Type: zip sciencedaily.zip (1.2 KB, 427 views)
kiklop74 is offline  
Old 12-20-2008, 06:54 PM   #67
girlperson1
Member
girlperson1 began at the beginning.
 
Posts: 21
Karma: 34
Join Date: Nov 2008
Device: Sony 505
Talking

Quote:
Originally Posted by kiklop74 View Post
here goes:
Thank you!!
girlperson1 is offline  
Old 12-20-2008, 10:35 PM   #68
ddavtian
Addict
ddavtian has a complete set of Star Wars action figures.ddavtian has a complete set of Star Wars action figures.ddavtian has a complete set of Star Wars action figures.ddavtian has a complete set of Star Wars action figures.
 
Posts: 262
Karma: 332
Join Date: Nov 2003
Location: San Francisco, USA
Device: Sony 505 & 900, Kindle DX, Samsung Galaxy Tab, EVO
Hi guys.

I wrote this simple code for Forbes. It works, could use better cleaning of the text. There is even a low resolution cover page :-) But it doesn't create the menu items for articles: Next, Previous, Main, etc.

If somebody can improve this, please post back.

Thanks, David

PHP Code:
class AdvancedUserRecipe1226018223(BasicNewsRecipe):
    
title          u'Forbes'
    
oldest_article 30
    max_articles_per_feed 
100
    no_stylesheets 
True
    html2lrf_options 
= ['--base-font-size''10']     

    
    
remove_tags_before  dict(id='p_RightTop')
    
remove_tags_after  dict(id='contextualLinks')
    
remove_tags = [dict(id=['controlsbox''sharePanel']),
           ]
    
feeds          = [(u'Latest'u'http://www.forbes.com/news/index.xml'), 
        (
u'Most Popular'u'http://www.forbes.com/feeds/popstories.xml'), 
        (
u'Most Emailed'u'http://www.forbes.com/feeds/mostemailed.xml'), 
        (
u'Faces'u'http://www.forbes.com/facesscan/index.xml'), 
        (
u'Technology'u'http://www.forbes.com/technology/index.xml'), 
        (
u'Personal Tech'u'http://www.forbes.com/personaltech/index.xml'), 
        (
u'Wireless'u'http://www.forbes.com/wireless/index.xml'),
        (
u'Business'u'http://www.forbes.com/business/index.xml'), 
        (
u'Sports Money'u'http://www.forbes.com/sportsmoney/index.xml'), 
        (
u'Sports'u'http://www.forbes.com/forbeslife/sports/index.xml'),
        (
u'Vehicles'u'http://www.forbes.com/forbeslife/vehicles/index.xml'),
        (
u'Leadership'u'http://www.forbes.com/leadership/index.xml'), 
        (
u'Careers'u'http://www.forbes.com/leadership/careers/index.xml'),
        (
u'Compensation'u'http://www.forbes.com/leadership/compensation/index.xml'),
        (
u'Managing'u'http://www.forbes.com/leadership/managing/index.xml')]


    
def get_cover_url(self):
        
self.cover_url  u'http://www.forbes.com/media/current_covers/forbes_120_160.gif'
        
cover =  self.cover_url
        
return cover 
ddavtian is offline  
Old 12-21-2008, 07:08 AM   #69
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: 780
Karma: 194642
Join Date: Dec 2007
Location: Argentina
Device: Kindle PaperWhite, Motorola Xoom
Forbes.com has a bit complicated layout of their pages and in such cases it is better to use print version of the page if it exists and in this case it does so this is modified version of your recipe:

Code:
from calibre.ebooks.BeautifulSoup import BeautifulSoup

class AdvancedUserRecipe1226018223(BasicNewsRecipe):
    title          = u'Forbes'
    oldest_article = 30
    max_articles_per_feed = 100
    no_stylesheets = True
    html2lrf_options = ['--base-font-size', '10']     

    cover_url  = u'http://www.forbes.com/media/current_covers/forbes_120_160.gif'
    
    feeds          = [(u'Latest', u'http://www.forbes.com/news/index.xml'), 
        (u'Most Popular', u'http://www.forbes.com/feeds/popstories.xml'), 
        (u'Most Emailed', u'http://www.forbes.com/feeds/mostemailed.xml'), 
        (u'Faces', u'http://www.forbes.com/facesscan/index.xml'), 
        (u'Technology', u'http://www.forbes.com/technology/index.xml'), 
        (u'Personal Tech', u'http://www.forbes.com/personaltech/index.xml'), 
        (u'Wireless', u'http://www.forbes.com/wireless/index.xml'),
        (u'Business', u'http://www.forbes.com/business/index.xml'), 
        (u'Sports Money', u'http://www.forbes.com/sportsmoney/index.xml'), 
        (u'Sports', u'http://www.forbes.com/forbeslife/sports/index.xml'),
        (u'Vehicles', u'http://www.forbes.com/forbeslife/vehicles/index.xml'),
        (u'Leadership', u'http://www.forbes.com/leadership/index.xml'), 
        (u'Careers', u'http://www.forbes.com/leadership/careers/index.xml'),
        (u'Compensation', u'http://www.forbes.com/leadership/compensation/index.xml'),
        (u'Managing', u'http://www.forbes.com/leadership/managing/index.xml')]

    def print_version(self, url):
        raw = self.browser.open(url).read()
        soup = BeautifulSoup(raw.decode('latin1', 'replace'))
        print_link = soup.find('a', {'onclick':"s_linkTrackVars='prop18';s_linkType='o';s_linkName='Print';if(typeof(globalPageName)!='undefined')s_prop18=globalPageName;s_lnk=s_co(this);s_gs(s_account);"})
        if print_link is None:
            return ''
        return 'http://www.forbes.com' + print_link['href']
BTW as you can see if you have a url of cover page just specify it by assigning value to cover_url. No need to override anything.
kiklop74 is offline  
Old 12-21-2008, 12:20 PM   #70
ddavtian
Addict
ddavtian has a complete set of Star Wars action figures.ddavtian has a complete set of Star Wars action figures.ddavtian has a complete set of Star Wars action figures.ddavtian has a complete set of Star Wars action figures.
 
Posts: 262
Karma: 332
Join Date: Nov 2003
Location: San Francisco, USA
Device: Sony 505 & 900, Kindle DX, Samsung Galaxy Tab, EVO
Thank you kiklop! I looked at print page but did not know how to use it.

If you have time, can you add a recipe for Time magazine? RSS feeds are on this page: http://www.time.com/time/rss.
ddavtian is offline  
Old 12-21-2008, 12:46 PM   #71
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: 780
Karma: 194642
Join Date: Dec 2007
Location: Argentina
Device: Kindle PaperWhite, Motorola Xoom
Quote:
Originally Posted by ddavtian View Post
Thank you kiklop! I looked at print page but did not know how to use it.

If you have time, can you add a recipe for Time magazine? RSS feeds are on this page: http://www.time.com/time/rss.
Here goes:
Attached Files
File Type: zip time.zip (999 Bytes, 367 views)
kiklop74 is offline  
Old 12-21-2008, 01:36 PM   #72
ddavtian
Addict
ddavtian has a complete set of Star Wars action figures.ddavtian has a complete set of Star Wars action figures.ddavtian has a complete set of Star Wars action figures.ddavtian has a complete set of Star Wars action figures.
 
Posts: 262
Karma: 332
Join Date: Nov 2003
Location: San Francisco, USA
Device: Sony 505 & 900, Kindle DX, Samsung Galaxy Tab, EVO
Thank you Kiklop, that was fast!

I tried twice, both times got this error:

Job: **Fetch news from Time**
**tuple**: ('IndexError', u'list index out of range')
**Traceback**:
Traceback (most recent call last):
File "parallel.py", line 935, in worker
File "parallel.py", line 893, in work
File "C:\Program Files\calibre\library.zip\calibre\ebooks\epub\from _feeds.py", line 64, in main
File "C:\Program Files\calibre\library.zip\calibre\ebooks\epub\from _feeds.py", line 54, in convert
File "calibre\ebooks\epub\from_html.pyo", line 328, in convert
File "calibre\ebooks\epub\from_html.pyo", line 173, in parse_content
File "calibre\ebooks\epub\from_html.pyo", line 113, in __init__
File "calibre\ebooks\html.pyo", line 532, in __init__
File "calibre\ebooks\html.pyo", line 413, in __init__
File "calibre\ebooks\html.pyo", line 472, in parse_html
File "lxml\html\__init__.pyo", line 114, in body
IndexError: list index out of range


Anytime I get an error (on any feed), after that I cannot fetch the same news again, I click on "download", it's not doing anything. I need to restart Calibre to try the errored out feed again.


EDIT: I changed the output format to lrf and it worked fine. Epub kept erroring out. Thanks again for the recipe.

Last edited by ddavtian; 12-21-2008 at 02:07 PM.
ddavtian is offline  
Old 12-21-2008, 02:23 PM   #73
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: 780
Karma: 194642
Join Date: Dec 2007
Location: Argentina
Device: Kindle PaperWhite, Motorola Xoom
I think you should report this bug so that it can be fixed. I always develop recipes assuming lrf usage since everything looks better in that format.
kiklop74 is offline  
Old 12-22-2008, 09:50 AM   #74
DougBarry
Junior Member
DougBarry began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Dec 2008
Device: PRS-700BC
Quote:
Originally Posted by kiklop74 View Post
Here goes:
Thank you.

Last edited by DougBarry; 12-22-2008 at 09:55 AM.
DougBarry is offline  
Old 12-22-2008, 02:08 PM   #75
Vaseline
Member
Vaseline began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Nov 2008
Device: Sony PRS 505
If anyone could do something with the daily mail for me - without judging me - that would be fantastic ;p.

http://www.dailymail.co.uk/home/rssMenu.html

Motoring/Sport/Property/ on there not needed really.
Vaseline is offline  
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom column read ? pchrist7 Calibre 2 10-04-2010 02:52 AM
Archive for custom screensavers sleeplessdave Amazon Kindle 1 07-07-2010 12:33 PM
How to back up preferences and custom recipes? greenapple Calibre 3 03-29-2010 05:08 AM
Donations for Custom Recipes ddavtian Calibre 5 01-23-2010 04:54 PM
Help understanding custom recipes andersent Calibre 0 12-17-2009 02:37 PM


All times are GMT -4. The time now is 08:33 AM.


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