From f45c317a69e7ae091aa9f4d5196fe312e988ed75 Mon Sep 17 00:00:00 2001 From: Alex Stanev Date: Fri, 22 Jul 2011 17:42:03 +0300 Subject: [PATCH] Use Kovid's affiliate id 30% of the time --- src/calibre/gui2/store/stores/eknigi_plugin.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/calibre/gui2/store/stores/eknigi_plugin.py b/src/calibre/gui2/store/stores/eknigi_plugin.py index ea29b43d5f..b2f5f170b6 100644 --- a/src/calibre/gui2/store/stores/eknigi_plugin.py +++ b/src/calibre/gui2/store/stores/eknigi_plugin.py @@ -6,6 +6,7 @@ __license__ = 'GPL 3' __copyright__ = '2011, Alex Stanev ' __docformat__ = 'restructuredtext en' +import random import urllib2 from contextlib import closing @@ -23,10 +24,12 @@ from calibre.gui2.store.web_store_dialog import WebStoreDialog class eKnigiStore(BasicStoreConfig, StorePlugin): def open(self, parent=None, detail_item=None, external=False): - #url = 'http://e-knigi.net/?amigosid=22' - #aff_suffix = '&amigosid=22' - url = 'http://e-knigi.net' - aff_suffix = '' + # Use Kovid's affiliate id 30% of the time + if random.randint(1, 10) in (1, 2, 3): + aff_suffix = '&amigosid=23' + else: + aff_suffix = '&amigosid=22' + url = 'http://e-knigi.net/?' + aff_suffix[1:] if external or self.config.get('open_external', False): if detail_item: