mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-29 15:04:55 +01:00
Add Kovids Amazon id.
This commit is contained in:
parent
1deb7783a1
commit
588adb70e4
1 changed files with 4 additions and 0 deletions
|
|
@ -4,6 +4,7 @@
|
|||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
import random
|
||||
import re
|
||||
import urllib2
|
||||
from contextlib import closing
|
||||
|
|
@ -107,6 +108,9 @@ def open(self, gui, parent=None, detail_item=None):
|
|||
'''
|
||||
from calibre.gui2 import open_url
|
||||
aff_id = {'tag': 'josbl0e-cpb-20'}
|
||||
# Use Kovid's affiliate id 30% of the time.
|
||||
if random.randint(1, 10) in (1, 2, 3):
|
||||
aff_id['tag'] = 'calibrebs-20'
|
||||
store_link = 'http://www.amazon.com/Kindle-eBooks/b/?ie=UTF&node=1286228011&ref_=%(tag)s&ref=%(tag)s&tag=%(tag)s&linkCode=ur2&camp=1789&creative=390957' % aff_id
|
||||
if detail_item:
|
||||
aff_id['asin'] = detail_item
|
||||
|
|
|
|||
Loading…
Reference in a new issue