chiark / gitweb /
strip more garbage out of twitter urls (esp the ?s=[:digits:]) tracking code - thanks...
[irc.git] / commands.py
index 3974bfbc8d9f9b886aed358f5d50b3c3a86fbab7..698bfdbe64c7161b83afba284a580203bfe2ff20 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 == {}: