From: Matthew Vernon Date: Tue, 11 Dec 2018 16:34:31 +0000 (+0000) Subject: strip more garbage out of twitter urls (esp the ?s=[:digits:]) tracking code - thanks... X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~matthewv/git?a=commitdiff_plain;h=af3b399b7517466d27bb1487fc7a45f3f92d7bcf;p=irc.git strip more garbage out of twitter urls (esp the ?s=[:digits:]) tracking code - thanks cjwatson --- diff --git a/commands.py b/commands.py index 3974bfb..698bfdb 100755 --- a/commands.py +++ b/commands.py @@ -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 == {}: