Created
August 13, 2013 01:09
-
-
Save justinamberson/6216919 to your computer and use it in GitHub Desktop.
StackOverflow Fanatic Golden Badge Helper
Awarded for 100 days of consecutive visits.
Defaults to opening the site every 12 hours (43200 seconds)
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
#StackOverflow Fanatic Badge Helper | |
#Justin Amberson 2013 : http://justin.amberson.net | |
#Fanatic Golden badge - 100 consecutive days on StackOverflow | |
import webbrowser | |
import time | |
def openURL(url): | |
webbrowser.open(url) | |
def main(secondsToWait): | |
stackURL = 'http://stackoverflow.com' | |
openURL(stackURL) | |
timeRemaining = secondsToWait | |
while timeRemaining > 0: | |
hours = timeRemaining / 3600 | |
minutes = (timeRemaining / 60) % 60 | |
seconds = timeRemaining % 60 | |
timeRemaining -= 1 | |
time.sleep(1) | |
print('Time Left '+ str(hours) + ':' + str(minutes) + ':' + str(seconds)) | |
if timeRemaining == 1: | |
openURL(stackURL) | |
timeRemaining = secondsToWait | |
main(43200) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment