Last active
February 7, 2023 13:54
-
-
Save ahmethakanbesel/e8090ccb6d2b5ecf9bbe5c8d64d7c82f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import platform | |
import requests | |
import threading | |
import os | |
url = "http://bys.marmara.edu.tr/Ogrenci/Ogr0208/SecilenDersler.aspx" | |
payload = {} | |
headers = { | |
'Cookie': 'ADD_COOKIES_HERE', | |
} | |
def check(): | |
threading.Timer(30.0, check).start() | |
response = requests.request("GET", url, headers=headers, data=payload) | |
filepath = None | |
if "Danışman İnceleme" in response.text: | |
print("Onay bekliyor.") | |
elif "Danışman Onay" in response.text: | |
filepath = "ringtone.mp3" | |
print("Onaylandı.") | |
else: | |
filepath = "expired.mp3" | |
print("Çerezlerin süresi dolmuş.") | |
if filepath is not None: | |
if platform.system() == 'Darwin': # macOS | |
subprocess.call(('open', filepath)) | |
elif platform.system() == 'Windows': # Windows | |
os.startfile(filepath) | |
else: # linux variants | |
subprocess.call(('xdg-open', filepath)) | |
check() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment