diff options
| author | makefu <github@syntax-fehler.de> | 2012-12-20 11:18:43 +0700 | 
|---|---|---|
| committer | makefu <github@syntax-fehler.de> | 2012-12-20 11:18:43 +0700 | 
| commit | 09dc57b9d5f564d13f80707eefadd845a4aa9aec (patch) | |
| tree | 977418d3f841e2ef16fc49775a76002e719aed28 | |
| parent | e2b9d1434ac87bf2fa160b09924eee84b9b123cb (diff) | |
//god/twinter - cleanup
| -rw-r--r-- | god/twinter/init_stripped.py | 10 | 
1 files changed, 5 insertions, 5 deletions
| diff --git a/god/twinter/init_stripped.py b/god/twinter/init_stripped.py index 4d359171..79550158 100644 --- a/god/twinter/init_stripped.py +++ b/god/twinter/init_stripped.py @@ -14,17 +14,16 @@ auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)  auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)  api = tweepy.API(auth)  mention = api.mentions()[0] -mention_stripped = mention.text.replace("@shacktwinter","").lstrip().rstrip() -mention_stripped = re.sub(r'[^\w _|@\[\]{}()<>:;!#$%^&+=-]+','',mention_stripped)[:32] +mention_stripped =re.sub(r'[^\w _|@\[\]{}()<>:;!#$%^&+=-]+','', +        mention.text.replace("@shacktwinter","").lstrip().rstrip())[:32]   f = open(os.path.dirname(os.path.abspath(sys.argv[0]))+"/msg_file","r+")  last = f.read() -#sys.exit(23) +  if last == mention_stripped:    print "received old message"    sys.exit(23)  else:    print "received new message: %s" % mention_stripped -      s = socket(AF_INET, SOCK_STREAM)    send_message = \      '\x1b%%-12345X@PJL JOB\n@PJL RDYMSG DISPLAY="%s"\n@PJL EOJ\n\x1b%%-12345X' % (mention_stripped, ) @@ -37,4 +36,5 @@ else:    f.close()    if not mention.user.following:            mention.user.follow() -  api.update_status("@%s i appreciate your message '%s' for twinter! Ready Message updated." %(mention.user.screen_name,mention_stripped.upper()),in_reply_to_status_id=mention.id) +  api.update_status("@%s i appreciate your message '%s' for twinter! Ready Message updated." % +          (mention.user.screen_name,mention_stripped.upper()),in_reply_to_status_id=mention.id) | 
