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 11-23-2008, 04:57 PM   #1
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,795
Karma: 4998511
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.
kovidgoyal is offline  
Old 12-01-2008, 02:54 AM   #2
AprilHare
Wizard
AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.
 
AprilHare's Avatar
 
Posts: 2,827
Karma: 11253505
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/
AprilHare is offline  
Old 12-01-2008, 05:23 AM   #3
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 AprilHare View Post
I'd like a good recipe for The St. Petersberg Times (sister paper of The Moscow Times). http://www.sptimes.ru/
This looks like a tough one. I hate sites that use feedsportal...
kiklop74 is offline  
Old 12-01-2008, 12:13 PM   #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: 780
Karma: 194642
Join Date: Dec 2007
Location: Argentina
Device: Kindle PaperWhite, Motorola Xoom
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)]
kiklop74 is offline  
Old 12-01-2008, 01:55 PM   #5
drnkusv
Member
drnkusv began at the beginning.
 
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.
drnkusv is offline  
Old 12-01-2008, 02:48 PM   #6
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 drnkusv View Post
I would appreciate if anyone can come up with a recipe for the Financial Times -- ft.com.

Thanks.
I tested this with free account.

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
kiklop74 is offline  
Old 12-02-2008, 05:42 PM   #7
drnkusv
Member
drnkusv began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Nov 2008
Device: iPhone
Thanks! Much appreciated.
drnkusv is offline  
Old 12-03-2008, 05:02 PM   #8
XanthanGum
Enthusiast
XanthanGum began at the beginning.
 
XanthanGum's Avatar
 
Posts: 48
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...
XanthanGum is offline  
Old 12-03-2008, 05:32 PM   #9
AprilHare
Wizard
AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.
 
AprilHare's Avatar
 
Posts: 2,827
Karma: 11253505
Join Date: Apr 2008
Device: Sony Reader PRS-T2
Quote:
Originally Posted by kiklop74 View Post
This looks like a tough one. I hate sites that use feedsportal...
Thanks for that! Much appreciated..
AprilHare is offline  
Old 12-03-2008, 05:36 PM   #10
hackettt
Enthusiast
hackettt is on a distinguished road
 
hackettt's Avatar
 
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.
hackettt is offline  
Old 12-03-2008, 05:48 PM   #11
AprilHare
Wizard
AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.
 
AprilHare's Avatar
 
Posts: 2,827
Karma: 11253505
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
AprilHare is offline  
Old 12-03-2008, 08:55 PM   #12
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 XanthanGum View Post
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...
Here goes:

See attachment
Attached Files
File Type: zip recipe_package.zip (3.3 KB, 1107 views)
kiklop74 is offline  
Old 12-04-2008, 12:06 AM   #13
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 AprilHare View Post
Hey: I'd like a recipe for Nature News: http://www.nature.com/news/rss-feeds.html
This site requires payed access to almost all content and since I do not have the interest to purchase subscription no testing can be done to produce adequate recipe.
kiklop74 is offline  
Old 12-04-2008, 12:29 AM   #14
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
News recipe:

Pagina 12, Argentinian newspaper (in spanish) (http://www.pagina12.com.ar/)
Attached Files
File Type: zip pagina12.zip (633 Bytes, 517 views)
kiklop74 is offline  
Old 12-04-2008, 08:17 AM   #15
AprilHare
Wizard
AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.AprilHare ought to be getting tired of karma fortunes by now.
 
AprilHare's Avatar
 
Posts: 2,827
Karma: 11253505
Join Date: Apr 2008
Device: Sony Reader PRS-T2
Quote:
Originally Posted by kiklop74 View Post
This site requires payed access to almost all content and since I do not have the interest to purchase subscription no testing can be done to produce adequate recipe.
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).
AprilHare 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 12:36 PM.


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