06:04 AM 03/05/2021
# Simple Python Item Notifier, written by Elfo.
from notifypy import Notify
import time, requests, json
while True:
# This is terrible code, seeing as instead of checking if the variable has changed, it just waits a second for a
time.sleep(1)
response = json.loads(requests.get("https://api.brick-hill.com/v1/shop/list?sort=newest&type=all&limit=1").text)
time.sleep(1)
response2 = json.loads(requests.get("https://api.brick-hill.com/v1/shop/list?sort=newest&type=all&limit=1").text)
if (response != response2):
notification = Notify()
notification.title = "New Item"
notification.message = "Brick-Hill Items"
notification.send()
print(response2)
from notifypy import Notify
import time, requests, json
while True:
# This is terrible code, seeing as instead of checking if the variable has changed, it just waits a second for a
time.sleep(1)
response = json.loads(requests.get("https://api.brick-hill.com/v1/shop/list?sort=newest&type=all&limit=1").text)
time.sleep(1)
response2 = json.loads(requests.get("https://api.brick-hill.com/v1/shop/list?sort=newest&type=all&limit=1").text)
if (response != response2):
notification = Notify()
notification.title = "New Item"
notification.message = "Brick-Hill Items"
notification.send()
print(response2)
06:05 AM 03/05/2021
i didnt' finish the code comment and this code wont work if pasted because brick-hill broke the indents
06:13 AM 03/05/2021
Would be cool though
06:29 AM 03/05/2021
Quote from 1nator , 06:27 AM 03/05/2021that's it, though i should have made it where it checks only the name and price and whether it's special or not, but i don't know how to format jsons in python and frankly it's 3AM and i couldn't give a damn
So this is basically like refreshing the page every second and checking if something changed