Apple Store Notifier

Apple announced new products a few days ago. As always, stock in the stores is limited. If you’re smart, you check online whether the product you want is available at your local Apple Store. If you’re lazy, use the following Python script to automate that. Note: Pushover is required. #!/usr/bin/env python3 import requests import os import time def fetch_availability(product_number, store_id): payload = { "store": store_id, "little": False, "mt": "regular", "parts.0": product_number, "fts": True, } url = "https://www.apple.com/de/shop/fulfillment-messages" r = requests.get(url, params=payload) data = r.json() stores = data["body"]["content"]["pickupMessage"]["stores"] store = next(store for store in stores if store["storeNumber"] == store_id) avail = store["partsAvailability"][product_number] return { "store_name": store.get("storeName"), "available": avail.get("pickupDisplay") != "ineligible", "store_pickup_quote": avail.get("storePickupQuote"), "pickup_search_quote": avail.get("pickupSearchQuote"), "pickup_display": avail.get("pickupDisplay"), } def assemble_availability_text(product_number, store_ids): avail_text = "" for store_id in store_ids: avail = fetch_availability(product_number, store_id) avail_text += f'{avail["store_name"]}: {avail["store_pickup_quote"]}\n' return avail_text def create_file_if_not_exists(filepath): if not os.path.exists(filepath): with open(filepath, "w") as f: f.write("") def do_it(part_no, store_ids, **kwargs): availability_text = assemble_availability_text(part_no, store_ids) create_file_if_not_exists("/tmp/cache.txt") with open("/tmp/cache.txt", "r+", encoding="utf-8") as f: if f.read() == availability_text: print("No Changes", flush=True) else: print("Changes detected", availability_text, flush=True) if kwargs["pushover_enabled"] == "1": requests.post( "https://api.pushover.net/1/messages.json", data={ "token": kwargs["pushover_token"], "user": kwargs["pushover_user"], "message": availability_text, "title": "CHANGES DETECTED", }, headers={"Content-Type": "application/x-www-form-urlencoded"}, ) f.truncate(0) f.seek(0) f.write(availability_text) if __name__ == "__main__": while True: do_it( os.environ["MONITORED_PART_NO"], os.environ["MONITORED_STORES"].split(","), pushover_enabled=os.environ["PUSHOVER_ENABLED"], pushover_token=os.environ["PUSHOVER_TOKEN"], pushover_user=os.environ["PUSHOVER_USER"], ) time.sleep(int(os.environ["POLLING_DELAY_SECONDS"])) The script is in the repository dprandzioch/apple-store-notifier on GitHub. ...

March 19, 2022 · 2 min · 243 words

Bad Lip Reading

The YouTube channel Bad Lip Reading redubs footage to create funny videos. This week it’s Apple’s turn with its product presentations. Very entertaining. Thanks Stephen The text was automatically translated from German into English. The German quotations were also translated in sense.

December 20, 2018 · 1 min · 42 words

4GB RAM

China’s Ministry of Industry and Information Technology (TENAA) requested technical information from Apple about the current iPhone models. The new phones have 4 GB of RAM Model Battery RAM iPhone XS Max 3,174mAh 4GB RAM iPhone XS 2,658mAh 4GB RAM iPhone X 2,716mAh 3GB RAM iPhone XR 2,942mAh 3GB RAM iPhone 8 Plus 2,675mAh 3GB RAM Source: Benjamin Mamerow on 20. September 2018 The text was automatically translated from German into English. The German quotations were also translated in sense. ...

September 22, 2018 · 1 min · 80 words

Fresh new dark theme

Many apps already have a dark mode, but there still isn’t a unified standard for it on iOS and macOS. Steve Troughton Smith fand in macOS 10.14 gives a hint of exactly such a mode. Developer Steve Troughton Smith today tweeted photos of macOS 10.14 with some very juicy details about Apple’s upcoming operating system. The OS is very clearly sporting a fresh new dark theme, presumably a toggle-able setting, with the dark UI affecting all application chrome. You can also see an icon for a Mac News app in the Dock, as well as a first look at Xcode 10. — 9to5mac.com ...

June 2, 2018 · 1 min · 136 words

GrayKey can unlock

Motherboard berichtet reported on a box capable of cracking an iPhone’s PIN. The GrayKey itself is a small, 4×4 inches box with two lightning cables for connecting iPhones, according to photographs published by cybersecurity firm Malwarebytes. The device comes in two versions: a $15,000 one which requires online connectivity and allows 300 unlocks (or $50 per phone), and an offline, $30,000 version which can crack as many iPhones as the customer wants. Marketing material seen by Forbes says GrayKey can unlock devices running iterations of Apple’s latest mobile operating system iOS 11, including on the iPhone X, Apple’s most recent phone. ...

April 14, 2018 · 1 min · 169 words