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 05-21-2009, 03:58 PM   #526
Rafardeon
Enthusiast
Rafardeon began at the beginning.
 
Posts: 39
Karma: 10
Join Date: Mar 2009
Location: Germany
Device: Sony PRS-505
I currently worked out my first (very simple) recipe (and learning python on the way ). It works pretty well on my PRS-505.
If anyone's interested: it's from PHD Comics:

Code:
class AdvancedUserRecipe1242934654(BasicNewsRecipe):
    title          = u'PHD Comics'
    oldest_article = 14
    max_articles_per_feed = 100

    feeds          = [(u'PHD Comics', u'http://www.phdcomics.com/gradfeed.php')]

    def print_version(self, url):
        return url.replace('http://www.phdcomics.com/comics.php?f=', 'http://www.phdcomics.com/comics/archive_print.php?comicid=')

Sorry, if there's a duplicate (couldn't scan all posts).
Rafardeon is offline  
Old 05-21-2009, 07:55 PM   #527
fromthewest
Junior Member
fromthewest began at the beginning.
 
Posts: 2
Karma: 10
Join Date: May 2009
Device: none
Problem Recipe:

I have been trying the following recipe, but it only downloads the first article from the rss feed.

What is wrong?

Code:
class AdvancedUserRecipe1242938672(BasicNewsRecipe):
    title          = u'The Hamilton Spectator'
    oldest_article = 1
    max_articles_per_feed = 100
    __author__     = 'Me'
    description    = 'News from the Hamilton Spectator'
    no_stylesheets = True

    keep_only_tags = [dict(id=['AssetWebPart1'])]


    feeds = [(u'Top Stories', u'http://www.thespec.com/rss/82672?searchMode=Lineup')]


    def print_version(self, url):
	return url.replace('http://www.thespec.com/article/', 'http://www.thespec.com/printArticle/')
Thanks
fromthewest is offline  
Advert
Old 05-21-2009, 09:45 PM   #528
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: 45,403
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Increase the value of oldest_article
kovidgoyal is offline  
Old 05-24-2009, 07:12 AM   #529
fromthewest
Junior Member
fromthewest began at the beginning.
 
Posts: 2
Karma: 10
Join Date: May 2009
Device: none
Quote:
Originally Posted by kovidgoyal View Post
Increase the value of oldest_article
Thank You.

I increased the value of oldest _article to 7.

It still only downloaded the first article in the rss feed.

-fromthewest
fromthewest is offline  
Old 05-24-2009, 07:52 AM   #530
Derry
Member
Derry began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Aug 2008
Device: Sony PRS505
IHT

For those looking for a Global NYTimes recipe, here is my attempt,
there are a couple of problems, too many blank pages at end of article, and it doesn't grab the second page etc of longer articles, tried url replace, opening browser etc, but I don't understand enough to get it working properly, still might be of use to some people,

Derry

Code:
class AdvancedUserRecipe1241195948(BasicNewsRecipe):
    title          = u'IHT/Global NYT'
    oldest_article = 1
    max_articles_per_feed = 10
    remove_tags_before = dict(id='article')
    remove_tags_after  = dict(id='article')
    remove_tags = [dict(attrs={'class':['articleTools', 'post-tools', 'side_tool', 'nextArticleLink clearfix']}), 
                   dict(id=['footer', 'toolsRight', 'articleInline', 'navigation', 'archive', 'side_search', 'blog_sidebar', 'side_tool', 'side_index']), 
                   dict(name=['script', 'noscript', 'style'])]
    encoding = 'cp1252'
    no_stylesheets = True
    extra_css = 'h1 {font: sans-serif large;}\n.byline {font:monospace;}'
    feeds          = [(u'Frontpage', u'http://www.nytimes.com/services/xml/rss/nyt/GlobalHome.xml'), (u'Europe', u'http://www.nytimes.com/services/xml/rss/nyt/Europe.xml'), (u'Americas', u'http://www.nytimes.com/services/xml/rss/nyt/Americas.xml'), (u'Africa', u'http://www.nytimes.com/services/xml/rss/nyt/Africa.xml'), (u'Asia Pacific', u'http://www.nytimes.com/services/xml/rss/nyt/AsiaPacific.xml'), (u'Middle East', u'http://www.nytimes.com/services/xml/rss/nyt/MiddleEast.xml'),(u'Opinion', u'http://www.nytimes.com/services/xml/rss/nyt/GlobalOpinion.xml'), (u'Business', u'http://www.nytimes.com/services/xml/rss/nyt/WorldBusiness.xml'), (u'Technology', u'http://feeds.nytimes.com/nyt/rss/Technology'), (u'Sports', u'http://www.nytimes.com/services/xml/rss/nyt/GlobalSports.xml'), (u'Science', u'http://www.nytimes.com/services/xml/rss/nyt/Science.xml'), (u'Environment', u'http://www.nytimes.com/services/xml/rss/nyt/Environment.xml'), (u'Health', u'http://www.nytimes.com/services/xml/rss/nyt/Health.xml'), (u'Arts', u'http://www.nytimes.com/services/xml/rss/nyt/Arts.xml'), (u'Travel', u'http://www.nytimes.com/services/xml/rss/nyt/Travel.xml')]
Derry is offline  
Advert
Old 05-24-2009, 01:47 PM   #531
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: 45,403
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by fromthewest View Post
Thank You.

I increased the value of oldest _article to 7.

It still only downloaded the first article in the rss feed.

-fromthewest
look at the debug output get it by clicking the job name
kovidgoyal is offline  
Old 05-28-2009, 07:18 AM   #532
cartman
Connoisseur
cartman began at the beginning.
 
Posts: 57
Karma: 22
Join Date: May 2009
Location: Mytilene, Greece
Device: Kobo Aura HD, Sony PRS-505 (Blue)
Hello, I would like to request a recipe for http://climateprogress.org. It is one of the best climate change blogs out there, and with large articles, so I think it is required reading for anybody concerned with the environment.
cartman is offline  
Old 05-28-2009, 11:12 AM   #533
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: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
New recipe for climate progress blog:
Attached Files
File Type: zip climate_progress.zip (916 Bytes, 257 views)
kiklop74 is offline  
Old 05-29-2009, 02:37 PM   #534
steviej
Junior Member
steviej began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Nov 2007
Device: Sony PRS-505
I am having trouble following directions in the user manual to create a recipe for a web site. Can anyone help? the website rss feed is "http://www.humanevents.com/rss/viewfromtheright.xml". Individual article feeds example "http://www.humanevents.com/article.php?id=29232" and print versions of the same are"http://www.humanevents.com/article.php?print=yes&id=29232". I cannot make this work to save my life. It looks simple, but I am not a programmer and I think that is my problem. I am using a PRS-505. Many Thanks......


....forget it, figured it out, the articles on the feed are over a year old!!!
StevieJ

Last edited by steviej; 05-30-2009 at 02:54 PM.
steviej is offline  
Old 05-30-2009, 12:53 PM   #535
cartman
Connoisseur
cartman began at the beginning.
 
Posts: 57
Karma: 22
Join Date: May 2009
Location: Mytilene, Greece
Device: Kobo Aura HD, Sony PRS-505 (Blue)
Hi kiklop74, thanks for the recipe! works like a charm! btw i seem to not be able to find the slashdot recipe in calibre (english news)
cartman is offline  
Old 05-30-2009, 01:29 PM   #536
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: 45,403
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by cartman View Post
Hi kiklop74, thanks for the recipe! works like a charm! btw i seem to not be able to find the slashdot recipe in calibre (english news)
Typo on my part, will be in next release.
kovidgoyal is offline  
Old 06-01-2009, 04:16 AM   #537
cartman
Connoisseur
cartman began at the beginning.
 
Posts: 57
Karma: 22
Join Date: May 2009
Location: Mytilene, Greece
Device: Kobo Aura HD, Sony PRS-505 (Blue)
About the climate progress recipe.
It works fine, but anything that is in double quotes is missing. For example, the text “What do you get when you buy a nuke? You get a lot of delays and rate increases….”, gets shown as “”
cartman is offline  
Old 06-01-2009, 08:14 AM   #538
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: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
Quote:
Originally Posted by cartman View Post
About the climate progress recipe.
It works fine, but anything that is in double quotes is missing. For example, the text “What do you get when you buy a nuke? You get a lot of delays and rate increases….”, gets shown as “”
That was my mistake. Here is updated recipe:
Attached Files
File Type: zip climate_progress.zip (880 Bytes, 560 views)
kiklop74 is offline  
Old 06-01-2009, 12:27 PM   #539
cartman
Connoisseur
cartman began at the beginning.
 
Posts: 57
Karma: 22
Join Date: May 2009
Location: Mytilene, Greece
Device: Kobo Aura HD, Sony PRS-505 (Blue)
It works fine now, thanks!
cartman is offline  
Old 06-01-2009, 03:31 PM   #540
smirando
Junior Member
smirando began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Feb 2009
Device: sony prs700
I wonder if it might be possible to have an update to the Globe and Mail recipe. The site was recently radically redesigned, and so the existing recipie no longer works. I'm not a programmer, and can only program the most basic of full content rss feed sites. Thanks in advance.
smirando 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 02:17 PM.


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