Item Notifier

mwinger
Joined 11/01/2020
Posts 8,400
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)


mwinger
Joined 11/01/2020
Posts 8,400
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


[Fool] The fool on the hill
Joined 23/11/2019
Posts 4,062
06:13 AM 03/05/2021
Would be cool though


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


mwinger
Joined 11/01/2020
Posts 8,400
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


[JEM] YardSale
Joined 10/06/2020
Posts 4,245
09:27 PM 04/05/2021
we need that

1