summaryrefslogtreecommitdiffstats
path: root/god/twinter/init_stripped.py
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2012-09-14 04:17:25 +0200
committermakefu <github@syntax-fehler.de>2012-09-14 04:17:25 +0200
commiteec6b1b6fd17d2f6ff36dacd828c2cc6de4d753e (patch)
tree7460e449ff85ef59ee7d94d76ad4a8130a8e956b /god/twinter/init_stripped.py
parent24030c80df40781c13bcbeb407a6547dc98069be (diff)
twinter:whitelist messages
Diffstat (limited to 'god/twinter/init_stripped.py')
-rw-r--r--god/twinter/init_stripped.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/god/twinter/init_stripped.py b/god/twinter/init_stripped.py
index 092d239a..4d359171 100644
--- a/god/twinter/init_stripped.py
+++ b/god/twinter/init_stripped.py
@@ -2,6 +2,7 @@
import os.path
import sys
import tweepy
+import re
from socket import *
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
@@ -13,7 +14,8 @@ 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().replace(" "," ")[:32]
+mention_stripped = mention.text.replace("@shacktwinter","").lstrip().rstrip()
+mention_stripped = re.sub(r'[^\w _|@\[\]{}()<>:;!#$%^&+=-]+','',mention_stripped)[:32]
f = open(os.path.dirname(os.path.abspath(sys.argv[0]))+"/msg_file","r+")
last = f.read()
#sys.exit(23)