]
-def draw(t, imgflg = 0, keyword=None, fil=[], ig=[]):
+def draw(t, iot=False, keyword=None, fil=[], ig=[]):
"""
Draw the rainbow
"""
printNicely(line3)
# Display Image
- if imgflg and media_url:
+ if iot and media_url:
for mu in media_url:
response = requests.get(mu)
image_to_display(StringIO(response.content))
'--ignore',
help='Ignore specific screen_name.')
parser.add_argument(
- '-img',
- '--image',
- help='Display all photo on terminal.')
+ '-iot',
+ '--image-on-term',
+ action='store_true',
+ help='Display all image on terminal.')
return parser.parse_args()
if g['stuff'].isdigit():
num = g['stuff']
for tweet in reversed(t.statuses.home_timeline(count=num)):
- draw(t=tweet, imgflg=g['image'])
+ draw(t=tweet, iot=g['iot'])
printNicely('')
except:
num = HOME_TWEET_NUM
for tweet in reversed(t.statuses.user_timeline(count=num, screen_name=user[1:])):
- draw(t=tweet, imgflg=g['image'])
+ draw(t=tweet, iot=g['iot'])
printNicely('')
else:
printNicely(red('A name should begin with a \'@\''))
tid = db.rainbow_query(id)[0].tweet_id
t.favorites.create(_id=tid, include_entities=False)
printNicely(green('Favorited.'))
- draw(t.statuses.show(id=tid), imgflg=g['image'])
+ draw(t.statuses.show(id=tid), iot=g['iot'])
except:
printNicely(red('Omg some syntax is wrong.'))
tid = db.rainbow_query(id)[0].tweet_id
t.favorites.destroy(_id=tid)
printNicely(green('Okay it\'s unfavorited.'))
- draw(t.statuses.show(id=tid), imgflg=g['image'])
+ draw(t.statuses.show(id=tid), iot=g['iot'])
except:
printNicely(red('Sorry I can\'t unfavorite this tweet for you.'))
printNicely('Newest tweets:')
for i in reversed(xrange(SEARCH_MAX_RECORD)):
draw(t=rel[i],
- imgflg=g['image'],
+ iot=g['iot'],
keyword=g['stuff'].strip()[1:])
printNicely('')
else:
elif tweet.get('text'):
draw(
t=tweet,
- imgflg=args.image,
+ iot=args.image_on_term,
keyword=args.track_keywords,
fil=args.filter,
ig=args.ignore,
g['reset'] = True
g['prefix'] = True
g['stream_pid'] = p.pid
- g['image'] = args.image
+ g['iot'] = args.image_on_term
listen()
\ No newline at end of file