From: Christian Heller Date: Sat, 23 Jan 2016 09:21:24 +0000 (+0100) Subject: Improve mobile twitter URL pattern matching. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/%7B%7Bdb.prefix%7D%7D/conditions?a=commitdiff_plain;h=92520ed306f6e61d93b1c5b31cccb889002cdd7f;p=plomlombot-irc.git Improve mobile twitter URL pattern matching. --- 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 "$@"