This commit is contained in:
Kovid Goyal 2013-10-10 21:28:21 +05:30
parent 8b607437c4
commit e165bd4fde
3 changed files with 5 additions and 7 deletions

View File

@ -15,7 +15,7 @@ from calibre.utils.date import now as nowf
import os, datetime, re import os, datetime, re
from calibre.web.feeds.recipes import BasicNewsRecipe from calibre.web.feeds.recipes import BasicNewsRecipe
from contextlib import nested from contextlib import nested
from calibre.ebooks.BeautifulSoup import BeautifulSoup, Tag from calibre.ebooks.BeautifulSoup import BeautifulSoup
from calibre.ebooks.metadata.opf2 import OPFCreator from calibre.ebooks.metadata.opf2 import OPFCreator
from calibre.ebooks.metadata.toc import TOC from calibre.ebooks.metadata.toc import TOC
from calibre.ebooks.metadata import MetaInformation from calibre.ebooks.metadata import MetaInformation
@ -92,7 +92,7 @@ class AppleDaily(BasicNewsRecipe):
except: except:
cover = None cover = None
return cover return cover
def populate_article_metadata(self, article, soup, first): def populate_article_metadata(self, article, soup, first):
if first and hasattr(self, 'add_toc_thumbnail'): if first and hasattr(self, 'add_toc_thumbnail'):
picdiv = soup.find('img') picdiv = soup.find('img')
@ -112,7 +112,7 @@ class AppleDaily(BasicNewsRecipe):
articles.append({'title': title, 'url': articlelink}) articles.append({'title': title, 'url': articlelink})
feeds.append((sectitle, articles)) feeds.append((sectitle, articles))
return feeds return feeds
def create_opf(self, feeds, dir=None): def create_opf(self, feeds, dir=None):
if dir is None: if dir is None:
dir = self.output_dir dir = self.output_dir

View File

@ -1,13 +1,12 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import (unicode_literals, division, absolute_import, print_function) from __future__ import (unicode_literals, division, absolute_import, print_function)
store_version = 1 # Needed for dynamic plugin loading store_version = 1 # Needed for dynamic plugin loading
__license__ = 'GPL 3' __license__ = 'GPL 3'
__copyright__ = '2011, John Schember <john@nachtimwald.com>' __copyright__ = '2011, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en' __docformat__ = 'restructuredtext en'
import random
from contextlib import closing from contextlib import closing
from lxml import html from lxml import html
@ -32,7 +31,7 @@ class AmazonCAKindleStore(StorePlugin):
def open(self, parent=None, detail_item=None, external=False): def open(self, parent=None, detail_item=None, external=False):
#aff_id = {'tag': ''} #aff_id = {'tag': ''}
# Use Kovid's affiliate id 30% of the time. # Use Kovid's affiliate id 30% of the time.
#if random.randint(1, 10) in (1, 2, 3): # if random.randint(1, 10) in (1, 2, 3):
# aff_id['tag'] = 'calibrebs-20' # aff_id['tag'] = 'calibrebs-20'
# store_link = 'http://www.amazon.ca/Kindle-eBooks/b/?ie=UTF&node=1286228011&ref_=%(tag)s&ref=%(tag)s&tag=%(tag)s&linkCode=ur2&camp=1789&creative=390957' % aff_id # store_link = 'http://www.amazon.ca/Kindle-eBooks/b/?ie=UTF&node=1286228011&ref_=%(tag)s&ref=%(tag)s&tag=%(tag)s&linkCode=ur2&camp=1789&creative=390957' % aff_id
store_link = 'http://www.amazon.ca/ebooks-kindle/b/ref=sa_menu_kbo?ie=UTF8&node=2980423011' store_link = 'http://www.amazon.ca/ebooks-kindle/b/ref=sa_menu_kbo?ie=UTF8&node=2980423011'

View File

@ -7,7 +7,6 @@ __license__ = 'GPL 3'
__copyright__ = '2012-2013, Tomasz Długosz <tomek3d@gmail.com>' __copyright__ = '2012-2013, Tomasz Długosz <tomek3d@gmail.com>'
__docformat__ = 'restructuredtext en' __docformat__ = 'restructuredtext en'
import re
import urllib import urllib
from contextlib import closing from contextlib import closing