# built documents.
#
# The short X.Y version.
-version = '1.0.7'
+version = '1.0.8'
# The full version, including alpha/beta/rc tags.
-release = '1.0.7'
+release = '1.0.8'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
\r
- ``ufav 12`` will unfavorite tweet with *[id=12]*.\r
\r
+- ``share 12`` will copy tweet with *[id=12]* to your clipboard.\r
+\r
- ``del 12`` will delete tweet with *[id=12]*.\r
\r
- ``show image 12`` will show the image in tweet with *[id=12]* in your OS’s image viewer.\r
"FORMAT": {
"TWEET": {
"CLOCK_FORMAT" : "%Y/%m/%d %H:%M:%S",
- "DISPLAY" : "\n #name #nick #clock \n \u20AA:#rt_count \u2665:#fa_count id:#id #fav\n #tweet"
+ "DISPLAY" : "\n #name #nick #clock \n \u20AA:#rt_count \u2665:#fa_count id:#id via #client #fav\n #tweet"
},
"MESSAGE": {
"CLOCK_FORMAT" : "%Y/%m/%d %H:%M:%S",
"nick" : 37,
"clock" : 184,
"id" : 184,
+ "client" : 154,
"favorited" : 154,
"retweet_count" : 154,
"favorite_count" : 202,
"nick" : 112,
"clock" : 57,
"id" : 166,
+ "client" : 74,
"favorited" : 50,
"retweet_count" : 50,
"favorite_count" : 198,
"nick" : 64,
"clock" : 32,
"id" : 130,
+ "client" : 23,
"favorited" : 64,
"retweet_count" : 64,
"favorite_count" : 124,
"nick" : 67,
"clock" : 58,
"id" : 58,
+ "client" : 58,
"favorited" : 97,
"retweet_count" : 97,
"favorite_count" : 166,
favorited = t['favorited']
retweet_count = t['retweet_count']
favorite_count = t['favorite_count']
+ client = t['source']
date = parser.parse(created_at)
try:
clock_format = c['FORMAT']['TWEET']['CLOCK_FORMAT']
# Unescape HTML character
text = unescape(text)
+ # Get client name
+ try:
+ client = client.split('>')[-2].split('<')[0]
+ except:
+ client = None
+
# Get expanded url
try:
expanded_url = []
word = [wo for wo in formater.split() if '#id' in wo][0]
delimiter = color_func(c['TWEET']['id'])(id.join(word.split('#id')))
formater = delimiter.join(formater.split(word))
+ # Change client word
+ word = [wo for wo in formater.split() if '#client' in wo][0]
+ delimiter = color_func(c['TWEET']['client'])(
+ client.join(word.split('#client')))
+ formater = delimiter.join(formater.split(word))
# Change retweet count word
word = [wo for wo in formater.split() if '#rt_count' in wo][0]
delimiter = color_func(c['TWEET']['retweet_count'])(
printNicely('')
+def share():
+ """
+ Copy url of a tweet to clipboard
+ """
+ t = Twitter(auth=authen())
+ try:
+ id = int(g['stuff'].split()[0])
+ except:
+ printNicely(red('Sorry I can\'t understand.'))
+ return
+ tid = c['tweet_dict'][id]
+ tweet = t.statuses.show(id=tid)
+ url = 'https://twitter.com/' + \
+ tweet['user']['screen_name'] + '/status/' + str(tid)
+ os.system("echo '%s' | pbcopy" % url)
+ printNicely(green('Copied tweet\'s url to clipboard.'))
+
+
def delete():
"""
Delete
usage += s * 2 + \
light_green('ufav 12 ') + ' will unfavorite tweet with ' + \
light_yellow('[id=12]') + '.\n'
+ usage += s * 2 + \
+ light_green('share 12 ') + ' will copy the url of the tweet with ' + \
+ light_yellow('[id=12]') + ' to your clipboard.\n'
usage += s * 2 + \
light_green('del 12 ') + ' will delete tweet with ' + \
light_yellow('[id=12]') + '.\n'
'rep',
'del',
'ufav',
+ 'share',
's',
'mes',
'show',
reply,
delete,
unfavorite,
+ share,
search,
message,
show,
[], # reply
[], # delete
[], # unfavorite
+ [], # url
['#'], # search
['@'], # message
['image'], # show image
import os.path
# Bumped version
-version = '1.0.7'
+version = '1.0.8'
# Require
install_requires = [
"DECORATED_NAME" : 198,
"CYCLE_COLOR" :[198,57,166,50,179,74,112],
"TWEET" : {
+ "mynick" : 179,
"nick" : 112,
"clock" : 57,
"id" : 166,
+ "client" : 74,
"favorited" : 50,
"retweet_count" : 50,
"favorite_count" : 198,
"rt" : 179,
"link" : 74,
"hashtag" : 198,
+ "mytweet" : 179,
"keyword" : "on_light_green"
},
"MESSAGE" : {
"partner" : 112,
"me" : 112,
- "me_frame" : 74,
"partner_frame" : 198,
+ "me_frame" : 74,
"sender" : 112,
"recipient" : 112,
"to" : 50,
* `nick` : color for other Twitter __username__.
* `clock`: color for time of tweet.
* `id`: color for tweet's id.
+ * `client`: color for used Twitter client.
* `favorite`: color for the star symbol when a tweet is favorited by you.
* `retweet_count`: color for retweets count.
* `favorite_count`: color for favorites count.