Register Guidelines E-Books Today's Posts Search

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

Notices

Closed Thread
 
Thread Tools Search this Thread
Old 12-30-2009, 09:01 PM   #1051
jimmypatrick
Member
jimmypatrick began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Dec 2009
Location: Cupertino, CA
Device: Kindle 2, iPad
override <title> <body> ?

So I'm trying to write the ps3center recipe that was requested here. I've got the python for grabbing the correct "print" version, but the print version html doesn't come back with <title> or <body> which I think ebook-convert is looking for. The html in the print version is quite simple, but I can't figure out how to get it so ebook-convert will like it. Can someone who knows take a look?

Code:
class AdvancedUserRecipe1262158494(BasicNewsRecipe):
    title          = u'PS3Center'
    oldest_article = 7
    max_articles_per_feed = 100

    feeds          = [(u'PS3 Center', u'http://www.ps3center.net/rss.xml')]

    def print_version(self, url):
        article_id = url.split('/')[5]
        return 'http://www.ps3center.net/print.php?id=' +article_id

the print version looks like this:
http://www.ps3center.net/print.php?id=4216
jimmypatrick is offline  
Old 12-31-2009, 07:54 AM   #1052
evanmaastrigt
Connoisseur
evanmaastrigt doesn't litterevanmaastrigt doesn't litter
 
Posts: 78
Karma: 192
Join Date: Nov 2009
Device: Sony PRS-600
Bad HTML

Quote:
Originally Posted by jimmypatrick View Post
So I'm trying to write the ps3center recipe that was requested here.
You could try the following: add the following line at the top of your file (before the class declaration)
Code:
from calibre.ebooks.BeautifulSoup import BeautifulSoup
Then add the following method:
Code:
    def preprocess_html(self, soup):
        tag = soup.find('td')
        for attr, value in tag.attrs:
            del tag[attr]
        tag.name = 'div'

        newSoup = BeautifulSoup('<html><head><title></title></head><body></body></html>')
        newSoup.body.append(tag)

        return newSoup
Not tested, but should work.
evanmaastrigt is offline  
Advert
Old 12-31-2009, 09:39 PM   #1053
dhiru
Connoisseur
dhiru began at the beginning.
 
Posts: 83
Karma: 10
Join Date: Aug 2009
Device: iphone, Irex iliad, sony prs950, kindle Dx, Ipad
Can any one please make recipe for world in 2010 by the economist. it uses same userid& pass as for the economist.

http://www.economist.com/theworldin/
thanks
dhiru is offline  
Old 01-01-2010, 07:40 AM   #1054
spideog
Connoisseur
spideog will become famous soon enoughspideog will become famous soon enoughspideog will become famous soon enoughspideog will become famous soon enoughspideog will become famous soon enoughspideog will become famous soon enough
 
Posts: 68
Karma: 648
Join Date: Dec 2009
Device: PRS-300
Here is a recipe for RTE News from Ireland:

Code:
class AdvancedUserRecipe1262344746(BasicNewsRecipe):
    title          = u'RTE News'
    oldest_article = 7
    max_articles_per_feed = 100
    __author__ = u'Robin Phillips'

    remove_tags = [dict(attrs={'class':['topAd','botad','previousNextItem','headline','footerLinks','footernav']})]

    feeds          = [(u'News', u'http://www.rte.ie/rss/news.xml'), (u'Sport', u'http://www.rte.ie/rss/sport.xml'), (u'Soccer', u'http://www.rte.ie/rss/soccer.xml'), (u'GAA', u'http://www.rte.ie/rss/gaa.xml'), (u'Rugby', u'http://www.rte.ie/rss/rugby.xml'), (u'Racing', u'http://www.rte.ie/rss/racing.xml'), (u'Business', u'http://www.rte.ie/rss/business.xml'), (u'Entertainment', u'http://www.rte.ie/rss/entertainment.xml')]

    def print_version(self, url):
        return url.replace('http://www', 'http://m')
spideog is offline  
Old 01-01-2010, 08:42 AM   #1055
Sony Reader
Member
Sony Reader began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Sep 2009
Device: PRS 505
Hi evanmaastrigt, the cynewslive works fine for me. I've adapted it for Cyprus Weekly and it's attached.
Attached Files
File Type: zip Cyprus Weekly.zip (1.7 KB, 166 views)
Sony Reader is offline  
Advert
Old 01-01-2010, 10:37 AM   #1056
gatorfan
Member
gatorfan began at the beginning.
 
gatorfan's Avatar
 
Posts: 20
Karma: 28
Join Date: Aug 2009
Location: Arizona
Device: Kindle, Jetbook
How about a recipe for Pajamas Media?

http://pajamasmedia.com/?src=network

Last edited by gatorfan; 01-01-2010 at 10:38 AM. Reason: added URL
gatorfan is offline  
Old 01-01-2010, 12:47 PM   #1057
warndt
Junior Member
warndt began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Dec 2009
Device: Kindle
I would like a good recipe for the Milwaukee Journal Sentinel. The web address is: http://www.jsonline.com/

Thanks
Wayne
warndt is offline  
Old 01-01-2010, 03:13 PM   #1058
evanmaastrigt
Connoisseur
evanmaastrigt doesn't litterevanmaastrigt doesn't litter
 
Posts: 78
Karma: 192
Join Date: Nov 2009
Device: Sony PRS-600
New recipe for Hindustan Times

New recipe for the Hindustan Times:

hindustantimes.zip
evanmaastrigt is offline  
Old 01-01-2010, 03:31 PM   #1059
Krittika Goyal
Vox calibre
Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.
 
Krittika Goyal's Avatar
 
Posts: 412
Karma: 1175230
Join Date: Jan 2009
Device: Sony reader prs700, kobo
deleted

Last edited by Krittika Goyal; 01-01-2010 at 03:34 PM.
Krittika Goyal is offline  
Old 01-01-2010, 03:33 PM   #1060
Krittika Goyal
Vox calibre
Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.
 
Krittika Goyal's Avatar
 
Posts: 412
Karma: 1175230
Join Date: Jan 2009
Device: Sony reader prs700, kobo
Quote:
Originally Posted by cypherslock View Post
I would love to see a recipe for Psychology Today, or Scientific American Mind.
Next release will include a recipe for psychology today
Krittika Goyal is offline  
Old 01-01-2010, 04:15 PM   #1061
Krittika Goyal
Vox calibre
Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.
 
Krittika Goyal's Avatar
 
Posts: 412
Karma: 1175230
Join Date: Jan 2009
Device: Sony reader prs700, kobo
Quote:
Originally Posted by warndt View Post
I would like a good recipe for the Milwaukee Journal Sentinel. The web address is: http://www.jsonline.com/

Thanks
Wayne
will be included in next calibre release
Krittika Goyal is offline  
Old 01-01-2010, 04:22 PM   #1062
Krittika Goyal
Vox calibre
Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.
 
Krittika Goyal's Avatar
 
Posts: 412
Karma: 1175230
Join Date: Jan 2009
Device: Sony reader prs700, kobo
Quote:
Originally Posted by cypherslock View Post
I would love to see a recipe for Psychology Today, or Scientific American Mind.
Scientific American Mind as I can tell is a subscription based journal. If you want it included you would have to pm your account details to me.
Krittika Goyal is offline  
Old 01-01-2010, 07:33 PM   #1063
Krittika Goyal
Vox calibre
Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.Krittika Goyal ought to be getting tired of karma fortunes by now.
 
Krittika Goyal's Avatar
 
Posts: 412
Karma: 1175230
Join Date: Jan 2009
Device: Sony reader prs700, kobo
deleted. sorry just started using mobile read for real. made a couple of mistakes while posting.

Last edited by Krittika Goyal; 01-01-2010 at 07:54 PM.
Krittika Goyal is offline  
Old 01-01-2010, 08:02 PM   #1064
solitaire
Connoisseur
solitaire began at the beginning.
 
solitaire's Avatar
 
Posts: 64
Karma: 30
Join Date: Dec 2009
Device: iPad, Galaxy S5
Quote:
Originally Posted by evanmaastrigt View Post
New recipe for the Hindustan Times:

Attachment 42282
Thanks evanmaastright, much appreciated.
solitaire is offline  
Old 01-01-2010, 09:54 PM   #1065
Wravien
Junior Member
Wravien began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jan 2010
Device: Sony PRS-600
I would love a Recipe for http://www.WoW.com/rss.xml, one that pulls the articles from the link within the RSS feed. I usually use the Death Knight Rss Feed http://www.wow.com/category/death-knight/rss.xml a lot, but when I download through Calibre, it pulls the rss feed, but the article stops at "Click here to continue reading"

Any help would be appreciated.

Thanks,
Wravien is offline  
Closed Thread


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 11:56 AM.


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