September 5 2023
Use Python to tag multiple products w/ Amazon Affiliates (some of the ASINs seem to go "bad" if a product is delisted?
# loop through all books and create links
for book in all_books:
asin = book['asin']
title = book['title']
link = f"https://www.amazon.com/dp/{asin}/?ref=nosim?tag={amazon_tag}"
links.append({
"title": title,
"link": link,
"asin": asin,
"author": book['author'],
"book_id": book['book_id'],
})
# write both lists to json file { "links": [] }
with open('amazon_links.json', 'w') as f:
json.dump({"links": links}, f, indent=4)
NEW SHARE FN, WHO DIS