Skip to content

Commit 06009b3

Browse files
committed
Add constant to change affiliate ID (for now, may add config option later)
1 parent f33ecb9 commit 06009b3

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

plugins/amazon.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
SEARCH_URL = "http://www.amazon.com/s/"
1010

11+
# Feel free to set this to None or change it to your own ID.
12+
# Or leave it in to support CloudBot, it's up to you!
13+
AFFILIATE_TAG = "cloudbot-20"
14+
15+
1116

1217
@hook.command("amazon", "az")
1318
def amazon(text):
@@ -60,7 +65,11 @@ def amazon(text):
6065
rating_str = "No Ratings"
6166

6267
# generate a short url
63-
url = "http://www.amazon.com/dp/" + asin + "/?tag=cloudbot-20"
68+
if AFFILIATE_TAG:
69+
url = "http://www.amazon.com/dp/" + asin + "/?tag=cloudbot-20"
70+
else:
71+
url = "http://www.amazon.com/dp/" + asin + "/"
72+
6473
url = web.try_shorten(url)
6574

6675
tag_str = " - " + ", ".join(tags) if tags else ""

0 commit comments

Comments
 (0)