![]() |
#2686 |
Enthusiast
![]() Posts: 25
Karma: 10
Join Date: Nov 2008
Device: PRS505, Kindle 3G
|
just wanted to say thanks to Tony for the tip on the Slashdot feed - works perfectly and fits my "clipping to read the full story later" workflow - thanks!
I'm going to use my new knowledge of recipes to improve the register recipe as it is all right aligned - havent tackled css until now, so should be fun! |
![]() |
![]() |
#2687 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
You can access a tag's attributes by treating the Tag object as though it were a dictionary. Thus you want: Code:
if mydaddy['id'] == 'MainContent' ....... Code:
if mydaddy.has_key('id') and mydaddy['id'] == 'MainContent' ....... Last edited by Starson17; 09-11-2010 at 08:55 AM. |
|
![]() |
![]() |
#2688 | |
Addict
![]() Posts: 264
Karma: 62
Join Date: May 2010
Device: kindle 2, kindle 3, Kindle fire
|
Quote:
|
|
![]() |
![]() |
#2689 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Sep 2010
Device: Kindle 3
|
DeseretNews.com recipe help request
Hi there. I'm new to Calibre and was wondering if someone could help me with my recipe for the Deseret News (Salt Lake City, Utah, USA Newspaper, http://desnews.com ). I've cobbled something together from what I have seen in other recipes, but I can't get it to use the mobile url instead of the regular one. The stories come through, but with all the extra stuff I don't want. The mobile versions of the articles look pretty clean though, but I must be doing something wrong because it isn't using the mobile url for the stories.
Here is what I have so far: Spoiler:
Last edited by willswords; 09-11-2010 at 07:19 PM. |
![]() |
![]() |
#2690 | |
Addict
![]() Posts: 264
Karma: 62
Join Date: May 2010
Device: kindle 2, kindle 3, Kindle fire
|
Quote:
take note of the comments in the following code: Spoiler:
|
|
![]() |
![]() |
#2691 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Sep 2010
Device: Kindle 3
|
Awesome! Thanks for your help. This is exactly what I wanted. I really need to learn python so I can understand this better.
You mentioned in the comments that there is a log file... Where does Calibre save that? I poked around but couldn't find one. Last edited by willswords; 09-11-2010 at 07:20 PM. |
![]() |
![]() |
#2692 | |
Addict
![]() Posts: 264
Karma: 62
Join Date: May 2010
Device: kindle 2, kindle 3, Kindle fire
|
Quote:
ebook-convert recipename.recipe output_dir --test -vv > myrecipe.txt for example if your recipe was called billybob.recipe go to the command prompt in windows (cmd) and then find the calibre2 directory which in windows it is generally in c:/program files then in there type: ebook-convert billybob.recipe output_dir --test -vv > myrecipe.txt once the execution finishes then you can open up the myrecipe.txt file in wordpad, notepad, editor whatever and then look for errors or printed text to see if the code is doing what you wish for it to do. test will take and pull the first 2 articles for you. |
|
![]() |
![]() |
#2693 |
Member
![]() Posts: 13
Karma: 10
Join Date: Sep 2010
Device: K3
|
Wanted to thank Starson17 and TonytheBookworm for all their help... I still don't fully understand all that I'm doing, but because of your help and the 180 pages on this board, I've got some awesome stuff on my Kindle each day. Thanks to all!
|
![]() |
![]() |
#2694 |
Member
![]() Posts: 14
Karma: 10
Join Date: Sep 2010
Device: nook
|
Okay. I've joined the club using .bat files to run the command line so all things are good there. But! I'm working on a little thing that grabs the update from the National Hurricane Center and I thought it was so simple I'm working on it in Calibre's window. I know from the thread here that there's the complicated way of using parse_index or get_links to filter a set of links to follow, but I really wanted to filter by the built-in methods and I must be doing them all wrong because they don't work on my computer.
I just want it to ignore the links ending in '.zip' and '.kmz' Where am I going wrong with raw reg expressions? I've tried with and without "\", with and without "r", and I'm going buggy. (Now I know the text link says .shp, but they're .zip packages that are linked. Right now they or the kmz are being read into the e-book as text.) Spoiler:
|
![]() |
![]() |
#2695 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
|
![]() |
![]() |
#2696 | |
Member
![]() Posts: 14
Karma: 10
Join Date: Sep 2010
Device: nook
|
Quote:
|
|
![]() |
![]() |
#2697 | |
Addict
![]() Posts: 264
Karma: 62
Join Date: May 2010
Device: kindle 2, kindle 3, Kindle fire
|
Quote:
I'm not certain if the link will list the feeds each time for I have no known way of testing that. But the following code will use the link provided by the original poster and then parse the links on that page and look for Alison Berkley in the link text. If it finds it then that link will be used and converted in the print_url to the pretty print version... Spoiler:
|
|
![]() |
![]() |
#2698 | |
Member
![]() Posts: 14
Karma: 10
Join Date: Sep 2010
Device: nook
|
Quote:
![]() Now, cleaning up what comes back is a bit daunting. If my results equal yours, all I'm getting is a text string of the table served back to Calibre and that's what's in the page for each feed. I wanted this to work so bad I spent over an hour and didn't get very far. Last edited by cynvision; 09-12-2010 at 01:54 AM. Reason: didn't attach file properly |
|
![]() |
![]() |
#2699 | |
Member
![]() Posts: 14
Karma: 10
Join Date: Sep 2010
Device: nook
|
Quote:
|
|
![]() |
![]() |
#2700 | |
Addict
![]() Posts: 264
Karma: 62
Join Date: May 2010
Device: kindle 2, kindle 3, Kindle fire
|
Quote:
Basically take and parse the page for href's and put them in the soup. Then turn around and take that soup and parse it again and search using the re.compile that I already have in this. If you can't figure it out I'll see what I can come up with tomorrow. But it is 3am where I'm at and i'm tired zzzzzzzz ![]() |
|
![]() |
![]() |
|
![]() |
||||
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 |