Skip to content

Instantly share code, notes, and snippets.

@ahmethakanbesel
Last active February 7, 2023 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahmethakanbesel/e8090ccb6d2b5ecf9bbe5c8d64d7c82f to your computer and use it in GitHub Desktop.
Save ahmethakanbesel/e8090ccb6d2b5ecf9bbe5c8d64d7c82f to your computer and use it in GitHub Desktop.
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