chiark / gitweb /
strip more garbage out of twitter urls (esp the ?s=[:digits:]) tracking code - thanks...
authorMatthew Vernon <matthewv@chiark.greenend.org.uk>
Tue, 11 Dec 2018 16:34:31 +0000 (16:34 +0000)
committerMatthew Vernon <matthewv@chiark.greenend.org.uk>
Tue, 11 Dec 2018 16:34:31 +0000 (16:34 +0000)
commands.py

index 3974bfb..698bfdb 100755 (executable)
@@ -526,9 +526,9 @@ def getTweet(urlstring,twitapi,inclusion=False,recurlvl=0):
   unobfuscate_urls=True
   expand_included_tweets=True
   stringsout=[]
-  
-  parts = string.split(urlstring,'/')
-  tweetID = parts[-1]
+
+  path = urlparse.urlparse(urlstring).path
+  tweetID = path.split('/')[-1]
   try:
     status = twitapi.GetStatus(tweetID)
     if status == {}: