12-19-2008, 03:51 AM | #61 |
Enthusiast
Posts: 38
Karma: 16
Join Date: Nov 2008
Device: Iliad or Sony
|
|
12-19-2008, 01:02 PM | #62 |
Junior Member
Posts: 4
Karma: 10
Join Date: Dec 2008
Device: PRS-700BC
|
|
12-20-2008, 07:59 AM | #63 | |
Guru
Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
|
Quote:
|
|
12-20-2008, 11:08 AM | #64 |
Member
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?
|
12-20-2008, 04:01 PM | #65 |
Member
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!!! |
12-20-2008, 06:12 PM | #66 | |
Guru
Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
|
Quote:
|
|
12-20-2008, 06:54 PM | #67 |
Member
Posts: 21
Karma: 34
Join Date: Nov 2008
Device: Sony 505
|
|
12-20-2008, 10:35 PM | #68 |
Addict
Posts: 271
Karma: 332
Join Date: Nov 2003
Location: San Francisco, USA
Device: Sage, Elipsa, Oasis, Galaxy Tab 8U, S22U
|
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:
|
12-21-2008, 07:08 AM | #69 |
Guru
Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
|
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'] |
12-21-2008, 12:20 PM | #70 |
Addict
Posts: 271
Karma: 332
Join Date: Nov 2003
Location: San Francisco, USA
Device: Sage, Elipsa, Oasis, Galaxy Tab 8U, S22U
|
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. |
12-21-2008, 12:46 PM | #71 | |
Guru
Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
|
Quote:
|
|
12-21-2008, 01:36 PM | #72 |
Addict
Posts: 271
Karma: 332
Join Date: Nov 2003
Location: San Francisco, USA
Device: Sage, Elipsa, Oasis, Galaxy Tab 8U, S22U
|
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. |
12-21-2008, 02:23 PM | #73 |
Guru
Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
|
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.
|
12-22-2008, 09:50 AM | #74 |
Junior Member
Posts: 4
Karma: 10
Join Date: Dec 2008
Device: PRS-700BC
|
Last edited by DougBarry; 12-22-2008 at 09:55 AM. |
12-22-2008, 02:08 PM | #75 |
Member
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. |
Thread Tools | Search this Thread |
|
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 |