![]() |
#526 |
Enthusiast
![]() 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
![]() 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). |
![]() |
![]() |
#527 |
Junior Member
![]() 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/') |
![]() |
Advert | |
|
![]() |
#528 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,403
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Increase the value of oldest_article
|
![]() |
![]() |
#529 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: May 2009
Device: none
|
|
![]() |
![]() |
#530 |
Member
![]() 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')] |
![]() |
Advert | |
|
![]() |
#531 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,403
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
#532 |
Connoisseur
![]() 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.
|
![]() |
![]() |
#533 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
|
New recipe for climate progress blog:
|
![]() |
![]() |
#534 |
Junior Member
![]() 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. |
![]() |
![]() |
#535 |
Connoisseur
![]() 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)
|
![]() |
![]() |
#536 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,403
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
#537 |
Connoisseur
![]() 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 “” |
![]() |
![]() |
#538 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
|
That was my mistake. Here is updated recipe:
|
![]() |
![]() |
#539 |
Connoisseur
![]() Posts: 57
Karma: 22
Join Date: May 2009
Location: Mytilene, Greece
Device: Kobo Aura HD, Sony PRS-505 (Blue)
|
It works fine now, thanks!
|
![]() |
![]() |
#540 |
Junior Member
![]() 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.
|
![]() |
![]() |
|
![]() |
||||
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 |