Actually I recently made this type of script to check for my 3 Semester result. I used urllib2 and requests module to scrap through the result website. This script does very simple thing it finds for the keyword of Result of Semester 3 if it founds nothing it goes into sleep for next 15 minutes and if it gets it sends notification to my Desktop ( I use ubuntu so notification won't work in windows ).
Here is the code.
- #This is a script checks for Result of 3 sem every 15 Min
- #Author Harit Dholakia
- #Just for Fun
- import urllib2
- import re
- import os
- import time
- while 1:
- html_content = urllib2.urlopen('http://www.gtu.ac.in/results.asp').read()
- matches = re.findall('MCA SEM 3', html_content);
- if len(matches) == 0:
- os.system("notify-send 'Yeah' 'Result is not declared yet'")
- time.sleep(900)
- else:
- os.system("notify-send 'Oops' 'Result Declared'")
- quit()
Here the output.
I kept this script running for two days and I was the First one the get the news of Result.
I luckily scored good marks. :) :)
No comments:
Post a Comment