10-04-2010, 10:06 AM | #1 |
Junior Member
Posts: 2
Karma: 10
Join Date: Oct 2010
Device: Kindle 3
|
The Guardian, modified
A couple of modifications to the standard recipe for the Guardian:
1. On Sundays, the recipe will download the Observer main section (the Observer being effectively the "Sunday Guardian"). This allows you to set up Calibre to download and send every day, without getting a second copy of the Saturday Guardian on Sunday morning. 2. There is a variable "ignore_sections" which skips sections you don't want to see (I have absolutely no interest in seeing the Sport section, for example). |
10-04-2010, 10:09 AM | #2 |
Enjoying the show....
Posts: 14,270
Karma: 10462843
Join Date: Jun 2008
Location: Arizona
Device: A K1, Kindle Paperwhite, an Ipod, IPad2, Iphone, an Ipad Mini & macAir
|
Welcome to MobileRead, ajnorman
|
10-04-2010, 12:20 PM | #3 |
neilmarr
Posts: 7,215
Karma: 6000059
Join Date: Apr 2009
Location: Monaco-Menton, France
Device: sony
|
Yeah -- hi Anjorman. Good to hagve your company. And with interesting opening advice to boot. Best wishes. Neil
|
10-04-2010, 06:48 PM | #4 |
Addict
Posts: 264
Karma: 62
Join Date: May 2010
Device: kindle 2, kindle 3, Kindle fire
|
I like how you implemented the the weekday check in your recipe. I have one question for you or anyone else that might know the answer. Is there a command that can be used to abort the entire execution of a script? Because there are several recipes I have made that I would like to include a date check so It doesn't download the feed on the weekends or only downloads it on tues and Thursdays or something like that. so could someone please share with me the abort command ? Nevermind, I figured it out. This will fix the issue I was wanting to be added to caibre for a weekend or weekday only feature. Spoiler:
Last edited by TonytheBookworm; 10-04-2010 at 07:08 PM. |
10-05-2010, 12:12 PM | #5 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
I've been jammed with work recently, but did you notice the code Kovid posted for storing/retrieving data from a recipe? It could be useful in controlling the feeds/articles to prevent duplication from one recipe run to another, etc. |
|
10-05-2010, 02:09 PM | #6 | |
Addict
Posts: 264
Karma: 62
Join Date: May 2010
Device: kindle 2, kindle 3, Kindle fire
|
Quote:
|
|
10-05-2010, 02:14 PM | #7 |
Addict
Posts: 264
Karma: 62
Join Date: May 2010
Device: kindle 2, kindle 3, Kindle fire
|
Have you implemented anything using that storage feature yet? I see the code is pseudo in a sense. I would like to see it in action so I could understand better how it works.
|
10-05-2010, 03:07 PM | #8 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
No, I haven't implemented it in any recipes yet. However, it's similar to the first code I ever wrote for Calibre (and the first ... and last ... thing I showed Charles how to do) where I stored an option set in the GUI, then later retrieved that option setting for use on a subsequent run of Calibre. Until Kovid posted, I hadn't really thought of using it for recipes.
|
10-07-2010, 08:13 AM | #9 | |
Member
Posts: 19
Karma: 10
Join Date: Oct 2010
Device: Kindle 3
|
Quote:
TIA H |
|
10-08-2010, 02:52 AM | #10 |
Junior Member
Posts: 1
Karma: 10
Join Date: Oct 2010
Device: kindle
|
I have been downloading the custom Guardian News feature to my kindle for the past 2 weeks, however this week as a result of this change i believe i am now no longer getting any images, was this done on purpose or was it just missed in the tweak of the recipe. I personally would prefer to receive the images, the file was only around 2.5mb now its gone down to .4mb. Is there an easy way for me to go back to how it used to be?
|
10-08-2010, 05:01 AM | #11 |
Junior Member
Posts: 2
Karma: 10
Join Date: Oct 2010
Device: Kindle 3
|
Oh yes, I should have remembered that my custom recipe also removes images (which I usually don't want - the Guardian has some excellent photography but too many mugshots of columnists and pictures used for decoration rather than information). This is the offending code:
Code:
remove_tags = [ dict(name='div', attrs={'class':["video-content","videos-third-column"]}), dict(name='div', attrs={'id':["article-toolbox","subscribe-feeds",]}), dict(name='ul', attrs={'class':["pagination"]}), dict(name='ul', attrs={'id':["content-actions"]}), dict(name='img'), ] Code:
dict(name='img'), Code:
ignore_sections = ("Sport") Code:
ignore_sections = ("Sport", "Business") |
10-14-2010, 09:17 AM | #12 |
Junior Member
Posts: 3
Karma: 10
Join Date: Oct 2010
Device: Kindle 3
|
Good work on the modification :-)
I wonder if it would be possible to remove the Mugshots (which I agree are annoying) but still keep the regular photographs? So does this mean I don't need to use the Observer recipe at all now (or I guess I could wait till Sunday and find out :-) ) M. |
10-20-2010, 06:16 PM | #13 |
Junior Member
Posts: 5
Karma: 10
Join Date: Oct 2010
Device: Kindle 3
|
Smashing. Very useful.
adam |
10-28-2010, 05:15 AM | #14 |
Member
Posts: 12
Karma: 10
Join Date: Oct 2010
Device: kindle
|
I have had my Kindle for a few days only and I have to say that the ability to use it to read the Guardian every day is an unexpected and very welcome bonus. Thank you.
I have not edited the script at all but ignore_sections = ("Sport") doesn't work, I get all sections every day. Any idea where I might be going wrong? I also get all images, which is not as important to me but might be a clue. Thanks |
10-29-2010, 02:23 AM | #15 |
Junior Member
Posts: 5
Karma: 10
Join Date: Oct 2010
Device: Kindle 3
|
Hmm. Mine is fine. In fact I turned images back on...s
ounds like you haven't loaded the recipe correctly and that you're using the old Guardian recipe. Just a thought. I'm no expert. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Last Modified Date | jjansen | Calibre | 1 | 09-12-2010 10:16 PM |
Modified Cover | Mickey330 | PocketBook | 11 | 06-18-2010 05:49 AM |
Can a contract agreement be modified? | ficbot | Writers' Corner | 5 | 05-21-2010 05:10 AM |
Where are modified tags stored | Giuseppe Chillem | Calibre | 12 | 05-18-2010 03:33 PM |
jbl modified dictionary | jeff862 | Ectaco jetBook | 1 | 02-25-2010 09:31 PM |