dentarg / pynik

:tiger: Internet Relay Chat bot
Other
3 stars 2 forks source link

tweet.py: handle mobile.twitter.com #7

Closed dentarg closed 7 years ago

dentarg commented 9 years ago

Example: https://mobile.twitter.com/Bjornhassel/status/631852157831147520

dentarg commented 9 years ago

Hmm http://rubular.com/r/0h6u1JdYjN

$ git diff
diff --git a/plugins/tweet.py b/plugins/tweet.py
index 70b499a..25d0651 100644
--- a/plugins/tweet.py
+++ b/plugins/tweet.py
@@ -23,7 +23,7 @@ class Tweet:

 # called in plugins/title_reader.py
 def match_tweet_url(url):
-       status_regexp = '(http|https)://twitter.com/((#!/(\w+))|(\w+))/(status|statuses)/(\d+)'
+       status_regexp = '(http|https)://(www.|mobile.|)twitter.com/((#!/(\w+))|(\w+))/(status|statuses)/(\d+)'
        match = re.search(status_regexp, url, re.IGNORECASE)
        if not match:
                user_regexp = '(http|https):\/\/twitter.com\/(\w+)'

but didn't work in python

dentarg commented 8 years ago

Bump

12:46:54 < tigermann> https://mobile.twitter.com/goranhagglund/status/5876495392
73838593
12:46:55 <. rufwebot> Twitter
...
12:47:31 < tigermann> dentarg: skulle inte du fixa mobilelänkarba :)
dentarg commented 8 years ago

Bump

20:13:34 <..... hiwk> https://mobile.twitter.com/TravelGov/status/714910137106972673      
20:13:35 <. rufwebot> Twitter