Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 08-05-2009, 05:11 AM   #1
jbambridge
Kindle DX
jbambridge began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Aug 2009
Location: The Netherlands
Device: iPad and Kindle DX
Recipe problem on Kindle DX

I have been trying to hack together an updated recipe for the Guardian (guardian.co.uk) and have had some success (ie images are now appearing in the feeds as well as headings).

I still have a problem however with the display of the TOC on the Kindle DX. Only the first feed is compete, with only one article being shown for the next feed. All other feeds are missing. However, when I page through the mobi document on the Kindle DX, all the articles are actually there.

Any ideas what I should look for in the download HTML files from ebook-converter?

John
jbambridge is offline   Reply With Quote
Old 08-05-2009, 07:22 AM   #2
GRiker
Comparer of the Ephemeris
GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.
 
Posts: 1,496
Karma: 424697
Join Date: Mar 2009
Device: iPad
Display of the TOC has been modified in version 0.6 for the Kindle - it now uses the Kindle's native TOC and navigation features. Look at the the bottom of the screen and you should see 'View Articles List' or 'View Sections List'. Click the joystick to go to the Kindle TOC, and then you can select articles from that interface.

G
GRiker is offline   Reply With Quote
Advert
Old 08-06-2009, 01:27 AM   #3
elmoglick
Groupie
elmoglick doesn't litterelmoglick doesn't litterelmoglick doesn't litter
 
Posts: 165
Karma: 206
Join Date: Dec 2007
Location: Kansas City
Device: Kindle1, Kindle DX, Kindle DXG
Quote:
Originally Posted by GRiker View Post
Display of the TOC has been modified in version 0.6 for the Kindle - it now uses the Kindle's native TOC and navigation features. Look at the the bottom of the screen and you should see 'View Articles List' or 'View Sections List'. Click the joystick to go to the Kindle TOC, and then you can select articles from that interface.

G
That's a great feature. I have a related question - Is there a TOC "flag" of some sort in mobi or azw files? I had to remove the DRM from a few magazines in order to transfer them to a replacement K2 and they lost that handy TOC in the process. Is there a way to restore it? Any idea what might have happened?

Thanks,
El
elmoglick is offline   Reply With Quote
Old 08-06-2009, 03:49 AM   #4
jbambridge
Kindle DX
jbambridge began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Aug 2009
Location: The Netherlands
Device: iPad and Kindle DX
Quote:
Originally Posted by GRiker View Post
Display of the TOC has been modified in version 0.6 for the Kindle - it now uses the Kindle's native TOC and navigation features. Look at the the bottom of the screen and you should see 'View Articles List' or 'View Sections List'. Click the joystick to go to the Kindle TOC, and then you can select articles from that interface.

G
Thanks, but the Kindle TOC is working fine, just the data from the feed is not using it.

Other feeds (eg The Telegraph) all display n the TOC OK, but the output from my recipe for the Guardian only shows one topic in the Kindle TOC.

Are there specific HTML tags that the Kindle TOC uses to create the structure?

John
jbambridge is offline   Reply With Quote
Old 08-06-2009, 05:59 AM   #5
GRiker
Comparer of the Ephemeris
GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.
 
Posts: 1,496
Karma: 424697
Join Date: Mar 2009
Device: iPad
Lots of flags and many data structures in a properly structured MOBI periodical. The process to remove the DRM probably ignored some necessary elements. I don't think it's a simple process to simply turn it back on.

G

Quote:
Originally Posted by elmoglick View Post
That's a great feature. I have a related question - Is there a TOC "flag" of some sort in mobi or azw files? I had to remove the DRM from a few magazines in order to transfer them to a replacement K2 and they lost that handy TOC in the process. Is there a way to restore it? Any idea what might have happened?

Thanks,
El
GRiker is offline   Reply With Quote
Advert
Old 08-06-2009, 06:12 AM   #6
GRiker
Comparer of the Ephemeris
GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.
 
Posts: 1,496
Karma: 424697
Join Date: Mar 2009
Device: iPad
Quote:
Originally Posted by jbambridge View Post
Thanks, but the Kindle TOC is working fine, just the data from the feed is not using it.

Other feeds (eg The Telegraph) all display n the TOC OK, but the output from my recipe for the Guardian only shows one topic in the Kindle TOC.
If you post your recipe I'll take a look to see if I can spot the problem.

Quote:
Are there specific HTML tags that the Kindle TOC uses to create the structure?
John
In calibre, TOC structure is derived from the OPF and NCX files, which specify the section(s) and details like Title, Author and Description for the TOC. For recipes, these files are created dynamically. It is possible to create your own structured documents by providing properly constructed OPF and NCX files describing your HTML content, then wrapping everything up in an ePub for calibre to process. It's non-trivial, but not difficult.

G
GRiker is offline   Reply With Quote
Old 08-06-2009, 07:41 AM   #7
jbambridge
Kindle DX
jbambridge began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Aug 2009
Location: The Netherlands
Device: iPad and Kindle DX
Quote:
If you post your recipe I'll take a look to see if I can spot the problem.
Thanks G. Here is my recipe:
PHP Code:
#!/usr/bin/env  python
__license__   'GPL v3'
__copyright__ '2008, Kovid Goyal kovid@kovidgoyal.net'
__docformat__ 'restructuredtext en'

'''
www.guardian.co.uk
'''

from calibre.web.feeds.news import BasicNewsRecipe

class Guardian(BasicNewsRecipe):

    
title u'My Guardian'
    
language _('English')
    
encoding 'utf-8'
    
oldest_article 7
    max_articles_per_feed 
20
    remove_javascript     
True
    simultaneous_downloads 
1
    use_embedded_content 
False
    recursions 
0
    filter_regexps 
= [r'\.g\.doubleclick\.net']

    
timefmt ' [%a, %d %b %Y]'

    
keep_only_tags = [dict(id=['article-wrapper''main-article-info'])]




    
no_stylesheets True
    extra_css 
'h2 {font-size: medium;} \n h1 {text-align: left;}'


    
feeds = [
       (
'Front Page',     'http://feeds.guardian.co.uk/theguardian/rss'),
#        ('UK',             'http://feeds.guardian.co.uk/theguardian/uk/rss'),
#        ('Business',       'http://www.guardian.co.uk/business/rss'),
#        ('Politics',       'http://feeds.guardian.co.uk/theguardian/politics/rss'),
#        ('Culture',        'http://feeds.guardian.co.uk/theguardian/culture/rss'),
#        ('Money',          'http://feeds.guardian.co.uk/theguardian/money/rss'),
#        ('Life & Style',   'http://feeds.guardian.co.uk/theguardian/lifeandstyle/rss'),
#        ('Travel',         'http://feeds.guardian.co.uk/theguardian/travel/rss'),
#        ('Environment',    'http://feeds.guardian.co.uk/theguardian/environment/rss')
        
]

    
def print_version(selfurl):
        return 
url '/print' 
Any help very welcome.

John
jbambridge is offline   Reply With Quote
Old 08-06-2009, 08:20 AM   #8
GRiker
Comparer of the Ephemeris
GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.
 
Posts: 1,496
Karma: 424697
Join Date: Mar 2009
Device: iPad
The hash marks (#) in front of the feeds after 'Front Page' cause the rest of the line to be ignored. Remove the hash marks for the feeds you want to receive, and you should be good to go.

If you want to limit the number of articles in each section, change the '20' in 'max_articles_per_feed = 20' to a lower number.

G
GRiker is offline   Reply With Quote
Old 08-06-2009, 11:08 AM   #9
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
No need for all that complication since guardian feeds contain complete text of every article:

Code:
class Guardian_uk(BasicNewsRecipe):
    title                 = 'The Guardian'
    oldest_article        = 2
    max_articles_per_feed = 100
    no_stylesheets        = True
    use_embedded_content  = True
    encoding              = 'utf-8'
    language              = _('English')
    
    feeds              = [(u'News: Main Section', u'http://www.guardian.co.uk/theguardian/mainsection/rss')]

    remove_tags        = [dict(name='div', attrs={'class':['related','guRssAdvert','terms']})]
Just add more feeds you need
kiklop74 is offline   Reply With Quote
Old 08-06-2009, 01:24 PM   #10
jbambridge
Kindle DX
jbambridge began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Aug 2009
Location: The Netherlands
Device: iPad and Kindle DX
That's certainly a lot simpler.

Is there any way to retain the images referred to in the RSS feed under <media:content>?

John
jbambridge is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kindle 2 vs Kindle 2 - Screen Refresh Problem weatherman Amazon Kindle 1 09-16-2010 03:58 PM
New Recipe features supporting Kindle masthead images GRiker Calibre 6 08-27-2010 04:08 PM
Referrer problem with recipe Starson17 Calibre 7 06-26-2010 04:47 PM
Catholic News Recipe Problem funkgut Calibre 4 04-23-2010 02:08 PM
A problem with custom recipe joshdu1125 Calibre 1 05-03-2009 09:31 PM


All times are GMT -4. The time now is 09:39 PM.


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