Skip to content

Instantly share code, notes, and snippets.

@ricardodani
Created May 6, 2013 04:30
Show Gist options
  • Save ricardodani/5523355 to your computer and use it in GitHub Desktop.
Save ricardodani/5523355 to your computer and use it in GitHub Desktop.
Bot pra avisar quando o site do tickets for fun não está busy
# -*- encoding: utf-8 -*-
import requests
import sys
import time
def play_sound():
sys.stdout.write('\a')
def is_tff_busy():
url = 'http://www.ticketsforfun.com.br/'
req = requests.get(url)
if req.ok and 'tryAgainButton' not in req.content:
return True
else:
return False
def sleep():
time.sleep(5)
while True:
if not is_tff_busy():
print 'Site on!'
play_sound()
else:
print 'Site busy!'
sleep()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment