View Single Post
Old 06-30-2012, 08:57 PM   #1
pshute
Enthusiast
pshute can program the VCR without an owner's manual.pshute can program the VCR without an owner's manual.pshute can program the VCR without an owner's manual.pshute can program the VCR without an owner's manual.pshute can program the VCR without an owner's manual.pshute can program the VCR without an owner's manual.pshute can program the VCR without an owner's manual.pshute can program the VCR without an owner's manual.pshute can program the VCR without an owner's manual.pshute can program the VCR without an owner's manual.pshute can program the VCR without an owner's manual.
 
Posts: 39
Karma: 189896
Join Date: Feb 2012
Device: Sony PRS-T1, iPad Air
Fixed broken section of The Age recipe

Since I started using it several months ago, The Age recipe has always included a rogue section containing the whole main page of the site. I suspect this has happened because they changed the link to the main page at the bottom of the text only page from a relative to an absolute path.

Once fixed, it reduces the size of the resulting ePub from 1.3MB to 0.6MB, and the download time from 2.5 minutes to 0.5 minutes. I changed:
Code:
                title = self.tag_to_string(tag)
                sections[section].append({
                                 'title': title,
                                 'url'  : url,
                                 'date' : strftime('%a, %d %b %Z'),
                                 'description' : '',
                                 'content'     : '',
                                 })
to
Code:
                title = self.tag_to_string(tag)
                if url != 'http://www.theage.com.au':
                   sections[section].append({
                                 'title': title,
                                 'url'  : url,
                                 'date' : strftime('%a, %d %b %Z'),
                                 'description' : '',
                                 'content'     : '',
                                 })
Not sure if this is the most efficient fix, but it seems to work.
pshute is offline   Reply With Quote