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 a1ef7f8c3e2b60f9a61a4c2db1e8485e1b5ec5ae..e1ec06a4abf82f51a6a60a3a70c3673fe5bf53c5 100755 (executable)
@@ -114,7 +114,8 @@ def lineparser_loop(io, nickname):
 
                 def mobile_twitter_hack(url):
                     re1 = 'https?://(mobile.twitter.com/)[^/]+(/status/)'
 
                 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/':
                     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 1687ae91e5babf1cc3f81e9cdb690c9a3fc11d80..0777bb94d422b6ee6398ecf3aad47b9ae479d8ca 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
 pyvenv $DIR_ENV 
 source $DIR_ENV/bin/activate
 pip install -r requirements.txt
+#pip install -r requirements2.txt
 echo
 set +e
 python3 plomlombot.py "$@"
 echo
 set +e
 python3 plomlombot.py "$@"