Item Notifier

trippinondaydreams
Joined 11/01/2020
Posts 6,061
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)


trippinondaydreams
Joined 11/01/2020
Posts 6,061
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


[No20] Autokid311
Joined 23/11/2019
Posts 1,997
06:13 AM 03/05/2021
Would be cool though


[Brick] 1nator
Joined 11/10/2017
Posts 6,847
06:27 AM 03/05/2021
So this is basically like refreshing the page every second and checking if something changed


trippinondaydreams
Joined 11/01/2020
Posts 6,061
06:29 AM 03/05/2021
Quote from 1nator , 06:27 AM 03/05/2021
So this is basically like refreshing the page every second and checking if something changed
that'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


[RARE] TheEpicN00B
Joined 10/06/2020
Posts 1,192
09:27 PM 04/05/2021
we need that

1