From 92520ed306f6e61d93b1c5b31cccb889002cdd7f Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Sat, 23 Jan 2016 10:21:24 +0100 Subject: [PATCH] Improve mobile twitter URL pattern matching. --- plomlombot.py | 3 ++- run.sh | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/plomlombot.py b/plomlombot.py index a1ef7f8..e1ec06a 100755 --- a/plomlombot.py +++ b/plomlombot.py @@ -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 --- 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 "$@" -- 2.30.2