Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a16021e

Browse files
Merge pull request avinashkranjan#2944 from avinashkranjan/deepsource-transform-1add2576
format code with autopep8
2 parents f4c65ce + 12131dc commit a16021e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎Amazon Wishlist Notifier/script.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
WISHLIST_URL = 'https://www.amazon.com/gp/registry/wishlist/YOUR_WISHLIST_ID'
1313
CHECK_INTERVAL = 3600 # Check every hour
1414

15+
1516
def get_wishlist_items():
1617
headers = {
1718
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"
@@ -28,14 +29,16 @@ def get_wishlist_items():
2829
price_element = item.find('span', class_='a-offscreen')
2930
price = price_element.get_text().strip() if price_element else "Price not available"
3031
availability = "In stock" if "In Stock" in item.get_text() else "Out of stock"
31-
wishlist.append({'name': name, 'price': price, 'availability': availability})
32+
wishlist.append({'name': name, 'price': price,
33+
'availability': availability})
3234

3335
return wishlist
3436

3537
else:
3638
print("Failed to retrieve wishlist data from Amazon.")
3739
return []
3840

41+
3942
def send_email(subject, message):
4043
msg = MIMEText(message)
4144
msg['Subject'] = subject
@@ -48,6 +51,7 @@ def send_email(subject, message):
4851
server.sendmail(SENDER_EMAIL, RECIPIENT_EMAIL, msg.as_string())
4952
server.quit()
5053

54+
5155
def main():
5256
while True:
5357
wishlist_items = get_wishlist_items()
@@ -66,5 +70,6 @@ def main():
6670

6771
time.sleep(CHECK_INTERVAL)
6872

73+
6974
if __name__ == "__main__":
7075
main()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /