Created
March 26, 2014 00:34
-
-
Save datamafia/9774592 to your computer and use it in GitHub Desktop.
Waiting for the Bitwig - send DM to my Twitter account on change
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
#!/usr/bin/env python | |
import urllib2 | |
import time | |
class bitwig: | |
running = None | |
last_size = 0 | |
def __init__(self): | |
if not self.running: | |
self.running = 1 | |
while 1 == 1 : | |
self.run() | |
time.sleep(10) # pause 10 sec | |
def run(self): | |
response = urllib2.urlopen('http://www.bitwig.com/en/bitwig-studio') #target url | |
html = response.read() | |
sz = len(html) | |
print str(sz) | |
if sz != self.last_size: # reminder : will send a DM on start up | |
print 'from '+ str(self.last_size) + ' to ' + str(sz) | |
msg = str(self.last_size) + '-' + str(sz) | |
self.last_size = sz | |
response = urllib2.urlopen('http://localhost:3000/test/omnimono/'+msg) #local rails app sends me DM in twitter | |
go = bitwig() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thx, I wrote this fast and cheap. Much tighter!