11-23-2008, 04:57 PM | #1 |
creator of calibre
Posts: 44,409
Karma: 23977332
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Custom recipes (archive, read-only)
Since there have been a lot of custom recipe requests of late, I'm starting a sticky where they can be aggregated. Post requests for custom recipes here. Once you have a custom recipe that works well for you (please test both the LRF and EPUB versions), let me know and I'll include it into calibre so others can benefit from it as well.
|
12-01-2008, 02:54 AM | #2 |
Wizard
Posts: 2,981
Karma: 11862367
Join Date: Apr 2008
Device: Sony Reader PRS-T2
|
I'd like a good recipe for The St. Petersberg Times (sister paper of The Moscow Times). http://www.sptimes.ru/
|
Advert | |
|
12-01-2008, 05:23 AM | #3 | |
Guru
Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
|
Quote:
|
|
12-01-2008, 12:13 PM | #4 |
Guru
Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
|
OK here goes:
Code:
#!/usr/bin/env python __license__ = 'GPL v3' __copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>' ''' sptimes.ru ''' from calibre import strftime from calibre.web.feeds.news import BasicNewsRecipe class Petersburgtimes(BasicNewsRecipe): title = u'The st.Petersburg Times' __author__ = 'Darko Miletic' description = 'News from Russia' oldest_article = 7 max_articles_per_feed = 100 no_stylesheets = True use_embedded_content = False INDEX = 'http://www.sptimes.ru' def parse_index(self): articles = [] soup = self.index_to_soup(self.INDEX) for item in soup.findAll('a', attrs={'class':'story_link_o'}): if item.has_key('href'): url = self.INDEX + item['href'].replace('action_id=2','action_id=100') title = self.tag_to_string(item) c_date = strftime('%A, %d %B, %Y') description = '' articles.append({ 'title':title, 'date':c_date, 'url':url, 'description':description }) return [(soup.head.title.string, articles)] |
12-01-2008, 01:55 PM | #5 |
Member
Posts: 21
Karma: 10
Join Date: Nov 2008
Device: iPhone
|
FT
I would appreciate if anyone can come up with a recipe for the Financial Times -- ft.com.
Thanks. |
Advert | |
|
12-01-2008, 02:48 PM | #6 | |
Guru
Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
|
Quote:
Here goes: Code:
#!/usr/bin/env python __license__ = 'GPL v3' __copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>' ''' ft.com ''' from calibre import strftime from calibre.web.feeds.news import BasicNewsRecipe class FinancialTimes(BasicNewsRecipe): title = u'Financial Times' __author__ = 'Darko Miletic' description = 'Financial world news' oldest_article = 2 max_articles_per_feed = 100 no_stylesheets = True use_embedded_content = False needs_subscription = True simultaneous_downloads= 1 delay = 1 LOGIN = 'https://registration.ft.com/registration/barrier/login' def get_browser(self): br = BasicNewsRecipe.get_browser() if self.username is not None and self.password is not None: br.open(self.LOGIN) br.select_form(name='loginForm') br['username'] = self.username br['password'] = self.password br.submit() return br keep_only_tags = [ dict(name='div', attrs={'id':'cont'}) ] remove_tags_after = dict(name='p', attrs={'class':'copyright'}) remove_tags = [ dict(name='div', attrs={'id':'floating-con'}) ] feeds = [ (u'UK' , u'http://www.ft.com/rss/home/uk' ) ,(u'US' , u'http://www.ft.com/rss/home/us' ) ,(u'Asia' , u'http://www.ft.com/rss/home/asia' ) ,(u'Middle East', u'http://www.ft.com/rss/home/middleeast') ] def preprocess_html(self, soup): content_type = soup.find('meta', {'http-equiv':'Content-Type'}) if content_type: content_type['content'] = 'text/html; charset=utf-8' return soup |
|
12-02-2008, 05:42 PM | #7 |
Member
Posts: 21
Karma: 10
Join Date: Nov 2008
Device: iPhone
|
Thanks! Much appreciated.
|
12-03-2008, 05:02 PM | #8 |
Connoisseur
Posts: 51
Karma: 10
Join Date: Dec 2008
Location: Germany
Device: SONY PRS-500
|
Hi,
I would like to have recipes created for the following online magazines: Harper's at: http://www.harpers.org/ Science News at: http://sciencenews.org/ The Nation at: http://www.thenation.com/ The online science news articles from Science (AAAS): http://sciencenow.sciencemag.org/ Spiegel International Online in English at: http://www.spiegel.de/international/ Thanks in advance... |
12-03-2008, 05:32 PM | #9 |
Wizard
Posts: 2,981
Karma: 11862367
Join Date: Apr 2008
Device: Sony Reader PRS-T2
|
|
12-03-2008, 05:36 PM | #10 |
Enthusiast
Posts: 31
Karma: 58
Join Date: Nov 2008
Device: Sony 505
|
Football Recipes
I have been trying to get a few Premier League Football sources (BBC, Sky Sports, Sun, Daily Telegraph, etc.) using the custom recipes. However, when I use the basic mode, I rarely get beyond a headline. When I use the Advanced Mode, it usually ends in an error.
If anyone would be so kind to generate a recipe for any of the above, I would be greatly appreciative. Cheers. |
12-03-2008, 05:48 PM | #11 |
Wizard
Posts: 2,981
Karma: 11862367
Join Date: Apr 2008
Device: Sony Reader PRS-T2
|
Hey: I'd like a recipe for Nature News: http://www.nature.com/news/rss-feeds.html
|
12-03-2008, 08:55 PM | #12 | |
Guru
Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
|
Quote:
See attachment |
|
12-04-2008, 12:06 AM | #13 | |
Guru
Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
|
Quote:
|
|
12-04-2008, 12:29 AM | #14 |
Guru
Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
|
|
12-04-2008, 08:17 AM | #15 |
Wizard
Posts: 2,981
Karma: 11862367
Join Date: Apr 2008
Device: Sony Reader PRS-T2
|
Thanks for taking a look. I was only interested in free content (no subscription here either; I got used to nature news when I had access to a institutional subscription).
|
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 |