-
-
Save ehzawad/2fe32acac93fd727f6a1d5fc1a57890e to your computer and use it in GitHub Desktop.
A python script to periodically check if SSC results been published or not
This file contains hidden or 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
from urllib.parse import urlencode | |
from urllib.request import Request, urlopen | |
from os import popen | |
import threading | |
def check_result(): | |
"""A python script to periodically check if SSC resulthas been published or not""" | |
timer = 5.0 #seconds | |
print("checking...") | |
url = 'http://mail.educationboard.gov.bd/web/result.php' # Set destination URL here | |
post_fields = {'board': 'com','eiin': '107536','rtype': 'SSC_FINAL'} # Set POST fields here | |
request = Request(url, urlencode(post_fields).encode()) | |
json = urlopen(request).read().decode() | |
if("Not published" not in json): | |
print(json); | |
cmd = "x-www-browser http://mail.educationboard.gov.bd/web/" | |
popen(cmd) | |
else: | |
print("Not published yet.") | |
#thread restarts itself every time result is not published | |
threading.Timer(timer, check_result).start() | |
check_result(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment