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 01-13-2010, 02:28 PM   #1141
XanthanGum
Connoisseur
XanthanGum began at the beginning.
 
XanthanGum's Avatar
 
Posts: 51
Karma: 10
Join Date: Dec 2008
Location: Germany
Device: SONY PRS-500
Recipe for Think Progress

Hi,

I'm attaching a recipe for Think Progress, a site that serves as a forum to advance progressive ideas and policies.

Enjoy...

XG
Attached Files
File Type: zip thinkProgress.zip (412 Bytes, 168 views)
XanthanGum is offline  
Old 01-13-2010, 03:06 PM   #1142
XanthanGum
Connoisseur
XanthanGum began at the beginning.
 
XanthanGum's Avatar
 
Posts: 51
Karma: 10
Join Date: Dec 2008
Location: Germany
Device: SONY PRS-500
Need Recipe for MIT Technology Review

Hi,

I've given up on coming up with a good recipe for MIT's Technology Review at:

http://www.technologyreview.com/

Questions:

Some of the reports at MIT Technology Review are split across multiple pages. How do you deal with that?

In the middle of some of the articles, a line stating "Story continues below" occurs along with an advertisement. How do I cut that out?

The site has a print option for each article, but it uses the article id number in each of the print URLs. How would I deal with that?

I hope someone will improve my recipe and post it here so that I can see how to solve the problems I ran into.

Thanks...

XG

My recipe follows:

from calibre.web.feeds.news import BasicNewsRecipe

class MITtechnologyReview(BasicNewsRecipe):
title = u'MIT Technology Review'
__author__ = u'Xanthan Gum'
description = 'Technology news from MIT'

no_stylesheets = True

remove_tags_before = dict(id='articlebody')
remove_tags_after = dict(name='h3')

oldest_article = 7
max_articles_per_feed = 100

feeds = [(u'Top Stories', u'http://feeds.technologyreview.com/technology_review_top_stories'),
(u'Computing', u'http://feeds.technologyreview.com/technology_review_Computing'),
(u'Web', u'http://feeds.technologyreview.com/technology_review_Web'),
(u'Communications', u'http://feeds.technologyreview.com/technology_review_Communications'),
(u'Energy', u'http://feeds.technologyreview.com/technology_review_Energy'),
(u'Materials', u'http://feeds.technologyreview.com/technology_review_Materials'),
(u'Biomedicine', u'http://feeds.technologyreview.com/technology_review_Biotech'),
(u'Business', u'http://feeds.technologyreview.com/technology_review_Biztech')]
XanthanGum is offline  
Old 01-13-2010, 06:24 PM   #1143
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 XanthanGum View Post
Hi,

I've given up on coming up with a good recipe for MIT's Technology Review at:

http://www.technologyreview.com/

Questions:

Some of the reports at MIT Technology Review are split across multiple pages. How do you deal with that?
See source of Adventure Gamers recipe which deals with multiple page articles.
kiklop74 is offline  
Old 01-14-2010, 05:04 AM   #1144
XanthanGum
Connoisseur
XanthanGum began at the beginning.
 
XanthanGum's Avatar
 
Posts: 51
Karma: 10
Join Date: Dec 2008
Location: Germany
Device: SONY PRS-500
Where to find all of the recipes

Quote:
Originally Posted by kiklop74 View Post
See source of Adventure Gamers recipe which deals with multiple page articles.
kiklop,

Where can I find the recipe you suggested and any of the others in Calibre?

Thanks...

XG
XanthanGum is offline  
Old 01-14-2010, 05:16 AM   #1145
XanthanGum
Connoisseur
XanthanGum began at the beginning.
 
XanthanGum's Avatar
 
Posts: 51
Karma: 10
Join Date: Dec 2008
Location: Germany
Device: SONY PRS-500
Recipes found

Quote:
Originally Posted by XanthanGum View Post
kiklop,

Where can I find the recipe you suggested and any of the others in Calibre?

Thanks...

XG
kiklop,

I found the recipes. Forgot that the source was posted just recently.

I will explore some, like the one you suggested.

Thanks again...

XG
XanthanGum is offline  
Old 01-14-2010, 07:40 AM   #1146
lorenzov
Member
lorenzov began at the beginning.
 
lorenzov's Avatar
 
Posts: 23
Karma: 12
Join Date: Jan 2010
Location: Edinburgh, UK
Device: SONY PRS600, Apple iPhone 3G
Hi Brian, i did change the recipe for the CSM, but after looking at the Atlantic seems quite different and the types of content offered (current issues and 'voices' from the correspondents); as nobody seems to jump on it, i will look into it

lorenzo
lorenzov is offline  
Old 01-14-2010, 09:54 AM   #1147
wdrwc
Junior Member
wdrwc began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jan 2010
Device: htc hero
Quote:
Originally Posted by evanmaastrigt View Post
Their print version is hard to get at, but I think it can be done (calibre knows some nice tricks too).

But the easy strategy is to forget the print version and just use the article from the feed. Their HTML seems to be valid, so you could use the keep_only_tags and remove_tags properties to get rid of unwanted content. There is also the preprocess_html() method to refine the result even further.

If you have further questions feel free to post them.
evanmaastright:
Thanks for the suggestion. As Krittika wrote, there is a chance for the recipe in the next release.
In the mean tiime I would like to try to go further with my first recipe.
I do not understand why their print version is hard to get at.
It's true - I can not get it with web2disk but wget dowloads it properly.
Can you please explain where is difficulty?

/wdrwc
wdrwc is offline  
Old 01-14-2010, 11:01 AM   #1148
evanmaastrigt
Connoisseur
evanmaastrigt doesn't litterevanmaastrigt doesn't litter
 
Posts: 78
Karma: 192
Join Date: Nov 2009
Device: Sony PRS-600
Quote:
Originally Posted by wdrwc View Post
I do not understand why their print version is hard to get at.
I do not understand it either. That is the 'sort of' part of the 'hard to get'. :-) But maybe it is just me. I tried wget as well, and the only thing I can think of is that calibre does not like the comma's in the url.

But I did not investigate that, because I saw another potential problem. For the print version you need o.a. to substitute a '1,' with a '2029020,' If that number is based on the year or changed for any other reason, the recipe will break.

And as the original article is not that hard to get into shape, I think you you should go for that.
evanmaastrigt is offline  
Old 01-14-2010, 12:30 PM   #1149
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 evanmaastrigt View Post
I do not understand it either. That is the 'sort of' part of the 'hard to get'. :-) But maybe it is just me. I tried wget as well, and the only thing I can think of is that calibre does not like the comma's in the url.

But I did not investigate that, because I saw another potential problem. For the print version you need o.a. to substitute a '1,' with a '2029020,' If that number is based on the year or changed for any other reason, the recipe will break.

And as the original article is not that hard to get into shape, I think you you should go for that.
Yes the problem was with the commas and kovid said he would fix it. i think he did but then I forgot about it and did not write the recipe. If someone is trying to write this recipe now it should work. If its still a problem i will try to do it on the weekend.
Krittika Goyal is offline  
Old 01-14-2010, 01:24 PM   #1150
lorenzov
Member
lorenzov began at the beginning.
 
lorenzov's Avatar
 
Posts: 23
Karma: 12
Join Date: Jan 2010
Location: Edinburgh, UK
Device: SONY PRS600, Apple iPhone 3G
the Atlantic is working

Hi Brian,
it might sound a stupid question, but what version of calibre are you using?
i'm usin 0.6.33 therefore can't say if it is the case for other, but i have just used the atlantic recipe as it is and it seems to work fine for me (see attached).

this recipe is very intriguing as it parses the index of the current issue page and compiles a list of articles from there.
(have to admit that i'm still trying to figure out how it does the magic...)

however i noticed that on the actual site there are some sections which allow you to use RSS feeds. i'm not sure if it is possible to mix feeds with the current recipe - Kovid will know the answer to this and those python expert out there.

lorenzo
Attached Files
File Type: lrf The Atlantic [Thu, 14 Jan 2010] - calibre.lrf (465.5 KB, 176 views)
lorenzov is offline  
Old 01-14-2010, 02:07 PM   #1151
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 lorenzov View Post
Hi Brian,
it might sound a stupid question, but what version of calibre are you using?
i'm usin 0.6.33 therefore can't say if it is the case for other, but i have just used the atlantic recipe as it is and it seems to work fine for me (see attached).

this recipe is very intriguing as it parses the index of the current issue page and compiles a list of articles from there.
(have to admit that i'm still trying to figure out how it does the magic...)

however i noticed that on the actual site there are some sections which allow you to use RSS feeds. i'm not sure if it is possible to mix feeds with the current recipe - Kovid will know the answer to this and those python expert out there.

lorenzo
Lorenzo are you using a kindle? I wanted to fix the recipe and I mentioned it to kovid. He said that it worked fine on the kindle. He said the problem may be with the epub for the sony reader.
He said the epub can probably be viewed in calibre but not on the sony reader. I am not sure of the reason but it has something to do with the html of the page and how epub is more sensitive to it than mobi.

He said he maintains this recipe quite well usually as he reads it himself.
Krittika Goyal is offline  
Old 01-14-2010, 07:34 PM   #1152
Briand
Member
Briand began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Dec 2009
Location: Halifax, Nova Scotia
Device: Sony PRS-300
Thanks for your help Lorenzo...the recipe for The Atlantic worked as of early January...but it seemed to stop working properly in the last week or so...not sure if The Atlantic changed its site or?

Brian
Briand is offline  
Old 01-14-2010, 07:40 PM   #1153
Briand
Member
Briand began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Dec 2009
Location: Halifax, Nova Scotia
Device: Sony PRS-300
I'm using the latest version of Calibre but as Krittika suggests maybe it's an issue with my Sony reader....would love to find a solution, as it is also one of my regular reads.

Brian
Briand is offline  
Old 01-14-2010, 07:46 PM   #1154
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,384
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@Briand: I just downloaded the atlantic onto my 600 and it works fine. Try it again.
kovidgoyal is offline  
Old 01-15-2010, 03:05 AM   #1155
espariz
Junior Member
espariz began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Dec 2009
Device: Kindle 2 Global Wireless
Hello, first many many thanks for all recipes, I would like to read on my kindle 2 this spanish paper, if you have time it would be nice if you make a recipe, many thanks!!!

http://www.nortecastilla.es/rss/feeds/
espariz 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 09:10 PM.


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