Created
February 18, 2014 14:03
-
-
Save fgiobergia/9071562 to your computer and use it in GitHub Desktop.
Refresh every 60 seconds waiting for some exam's results to be published
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
require ('uri'); | |
require ('net/https'); | |
headers = { | |
# Your cookies here | |
'Cookie' => 'DEV_PORTAL=;OHS-didattica.polito.it-443=' | |
} | |
uri = URI('https://didattica.polito.it/pls/portal30/sviluppo.esami_da_registrare') | |
req = Net::HTTP.new(uri.host,uri.port) | |
req.use_ssl = true | |
req.verify_mode = OpenSSL::SSL::VERIFY_NONE | |
while true | |
req.get(uri.path,headers) do |chunk| | |
if chunk.match(/Elettrotecnica/) # course name | |
system 'chromium-browser http://www.youtube.com/watch?v=sXHRR5zAdz0' # action to do | |
exit | |
end | |
end | |
sleep (60) # time between refreshes | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment