summaryrefslogtreecommitdiffstats
path: root/god/twinter
diff options
context:
space:
mode:
Diffstat (limited to 'god/twinter')
-rw-r--r--god/twinter/init_stripped.py10
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)