Skip to content

Instantly share code, notes, and snippets.

@justinamberson
Created August 13, 2013 01:09
Show Gist options
  • Save justinamberson/6216919 to your computer and use it in GitHub Desktop.
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)
#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