home · contact · privacy
Improve mobile twitter URL pattern matching.
authorChristian Heller <c.heller@plomlompom.de>
Sat, 23 Jan 2016 09:21:24 +0000 (10:21 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sat, 23 Jan 2016 09:21:24 +0000 (10:21 +0100)
plomlombot.py
run.sh

index a1ef7f8..e1ec06a 100755 (executable)
@@ -114,7 +114,8 @@ def lineparser_loop(io, nickname):
 
                 def mobile_twitter_hack(url):
                     re1 = 'https?://(mobile.twitter.com/)[^/]+(/status/)'
-                    re2 = 'https?://mobile.twitter.com/([^/]+)/status/([^\?]+)'
+                    re2 = 'https?://mobile.twitter.com/([^/]+)/status/' \
+                        + '([^\?/]+)'
                     m = re.search(re1, url)
                     if m and m.group(1) == 'mobile.twitter.com/' \
                             and m.group(2) == '/status/':
diff --git a/run.sh b/run.sh
index 1687ae9..0777bb9 100755 (executable)
--- a/run.sh
+++ b/run.sh
@@ -9,6 +9,7 @@ DIR_ENV=.temp_env
 pyvenv $DIR_ENV 
 source $DIR_ENV/bin/activate
 pip install -r requirements.txt
+#pip install -r requirements2.txt
 echo
 set +e
 python3 plomlombot.py "$@"