+def share():
+ """
+ Copy url of a tweet to clipboard
+ """
+ t = Twitter(auth=authen())
+ try:
+ id = int(g['stuff'].split()[0])
+ tid = c['tweet_dict'][id]
+ except:
+ printNicely(red('Tweet id is not valid.'))
+ return
+ tweet = t.statuses.show(id=tid)
+ url = 'https://twitter.com/' + \
+ tweet['user']['screen_name'] + '/status/' + str(tid)
+ import platform
+ if platform.system().lower() == 'darwin':
+ os.system("echo '%s' | pbcopy" % url)
+ printNicely(green('Copied tweet\'s url to clipboard.'))
+ else:
+ printNicely('Direct link: ' + yellow(url))
+
+