2 Colorful user's timeline stream
4 from multiprocessing
import Process
14 from twitter
.stream
import TwitterStream
, Timeout
, HeartbeatTimeout
, Hangup
15 from twitter
.api
import *
16 from twitter
.oauth
import OAuth
, read_token_file
17 from twitter
.oauth_dance
import oauth_dance
18 from twitter
.util
import printNicely
19 from StringIO
import StringIO
24 from .consumer
import *
25 from .interactive
import *
27 from .c_image
import *
68 def parse_arguments():
72 parser
= argparse
.ArgumentParser(description
=__doc__
or "")
76 help='Timeout for the stream (seconds).')
79 '--heartbeat-timeout',
80 help='Set heartbeat timeout.',
86 help='Set stream to non-blocking.')
90 help='Search the stream for specific text.')
94 help='Filter specific screen_name.')
98 help='Ignore specific screen_name.')
103 help='Display all image on terminal.')
104 return parser
.parse_args()
109 Authenticate with Twitter OAuth
111 # When using rainbow stream you must authorize.
112 twitter_credential
= os
.environ
.get(
116 '')) + os
.sep
+ '.rainbow_oauth'
117 if not os
.path
.exists(twitter_credential
):
118 oauth_dance("Rainbow Stream",
122 oauth_token
, oauth_token_secret
= read_token_file(twitter_credential
)
130 def get_decorated_name():
132 Beginning of every line
134 t
= Twitter(auth
=authen())
135 name
= '@' + t
.account
.verify_credentials()['screen_name']
136 g
['original_name'] = name
[1:]
137 g
['decorated_name'] = color_func(c
['DECORATED_NAME'])('[' + name
+ ']: ')
138 g
['ascii_art'] = True
140 files
= os
.listdir('rainbowstream/colorset')
141 themes
= [f
.split('.')[0] for f
in files
if f
.split('.')[-1] == 'json']
150 target
= g
['stuff'].split()[0]
153 args
= parse_arguments()
155 if g
['stuff'].split()[-1] == '-f':
156 only
= raw_input('Only nicks: ')
157 ignore
= raw_input('Ignore nicks: ')
158 args
.filter = filter(None, only
.split(','))
159 args
.ignore
= filter(None, ignore
.split(','))
160 elif g
['stuff'].split()[-1] == '-d':
161 args
.filter = c
['ONLY_LIST']
162 args
.ignore
= c
['IGNORE_LIST']
164 printNicely(red('Sorry, wrong format.'))
168 if target
== 'public':
169 keyword
= g
['stuff'].split()[1]
170 if keyword
[0] == '#':
171 keyword
= keyword
[1:]
173 os
.kill(g
['stream_pid'], signal
.SIGKILL
)
174 args
.track_keywords
= keyword
182 g
['stream_pid'] = p
.pid
185 elif target
== 'mine':
187 os
.kill(g
['stream_pid'], signal
.SIGKILL
)
196 g
['stream_pid'] = p
.pid
199 printNicely(cyan('Only: ' + str(args
.filter)))
201 printNicely(red('Ignore: ' + str(args
.ignore
)))
203 g
['ascii_art'] = True
205 printNicely(red('Sorry I can\'t understand.'))
212 t
= Twitter(auth
=authen())
213 # Get country and town
215 country
= g
['stuff'].split()[0]
219 town
= g
['stuff'].split()[1]
223 avail
= t
.trends
.available()
226 trends
= t
.trends
.place(_id
=1)[0]['trends']
229 for location
in avail
:
230 # Search for country and Town
232 if location
['countryCode'] == country \
233 and location
['placeType']['name'] == 'Town' \
234 and location
['name'] == town
:
235 trends
= t
.trends
.place(_id
=location
['woeid'])[0]['trends']
237 # Search for country only
239 if location
['countryCode'] == country \
240 and location
['placeType']['name'] == 'Country':
241 trends
= t
.trends
.place(_id
=location
['woeid'])[0]['trends']
249 t
= Twitter(auth
=authen())
250 num
= c
['HOME_TWEET_NUM']
251 if g
['stuff'].isdigit():
252 num
= int(g
['stuff'])
253 for tweet
in reversed(t
.statuses
.home_timeline(count
=num
)):
254 draw(t
=tweet
, iot
=g
['iot'])
262 t
= Twitter(auth
=authen())
263 user
= g
['stuff'].split()[0]
266 num
= int(g
['stuff'].split()[1])
268 num
= c
['HOME_TWEET_NUM']
269 for tweet
in reversed(t
.statuses
.user_timeline(count
=num
, screen_name
=user
[1:])):
270 draw(t
=tweet
, iot
=g
['iot'])
273 printNicely(red('A name should begin with a \'@\''))
280 t
= Twitter(auth
=authen())
281 num
= c
['HOME_TWEET_NUM']
282 if g
['stuff'].isdigit():
283 num
= int(g
['stuff'])
284 for tweet
in reversed(t
.statuses
.mentions_timeline(count
=num
)):
285 draw(t
=tweet
, iot
=g
['iot'])
293 t
= Twitter(auth
=authen())
294 t
.statuses
.update(status
=g
['stuff'])
301 t
= Twitter(auth
=authen())
303 id = int(g
['stuff'].split()[0])
305 printNicely(red('Sorry I can\'t understand.'))
307 tid
= db
.rainbow_to_tweet_query(id)[0].tweet_id
308 t
.statuses
.retweet(id=tid
, include_entities
=False, trim_user
=True)
315 t
= Twitter(auth
=authen())
318 id = int(g
['stuff'].split()[0])
320 printNicely(red('Sorry I can\'t understand.'))
322 tid
= db
.rainbow_to_tweet_query(id)[0].tweet_id
323 # Get display num if exist
325 num
= int(g
['stuff'].split()[1])
327 num
= c
['RETWEETS_SHOW_NUM']
328 # Get result and display
329 rt_ary
= t
.statuses
.retweets(id=tid
, count
=num
)
331 printNicely(magenta('This tweet has no retweet.'))
333 for tweet
in reversed(rt_ary
):
334 draw(t
=tweet
, iot
=g
['iot'])
342 t
= Twitter(auth
=authen())
344 id = int(g
['stuff'].split()[0])
346 printNicely(red('Sorry I can\'t understand.'))
348 tid
= db
.rainbow_to_tweet_query(id)[0].tweet_id
349 t
.favorites
.create(_id
=tid
, include_entities
=False)
350 printNicely(green('Favorited.'))
351 draw(t
.statuses
.show(id=tid
), iot
=g
['iot'])
359 t
= Twitter(auth
=authen())
361 id = int(g
['stuff'].split()[0])
363 printNicely(red('Sorry I can\'t understand.'))
365 tid
= db
.rainbow_to_tweet_query(id)[0].tweet_id
366 user
= t
.statuses
.show(id=tid
)['user']['screen_name']
367 status
= ' '.join(g
['stuff'].split()[1:])
368 status
= '@' + user
+ ' ' + status
.decode('utf-8')
369 t
.statuses
.update(status
=status
, in_reply_to_status_id
=tid
)
376 t
= Twitter(auth
=authen())
378 rid
= int(g
['stuff'].split()[0])
380 printNicely(red('Sorry I can\'t understand.'))
382 tid
= db
.rainbow_to_tweet_query(rid
)[0].tweet_id
383 t
.statuses
.destroy(id=tid
)
384 printNicely(green('Okay it\'s gone.'))
391 t
= Twitter(auth
=authen())
393 id = int(g
['stuff'].split()[0])
395 printNicely(red('Sorry I can\'t understand.'))
397 tid
= db
.rainbow_to_tweet_query(id)[0].tweet_id
398 t
.favorites
.destroy(_id
=tid
)
399 printNicely(green('Okay it\'s unfavorited.'))
400 draw(t
.statuses
.show(id=tid
), iot
=g
['iot'])
408 t
= Twitter(auth
=authen())
409 if g
['stuff'].startswith('#'):
410 rel
= t
.search
.tweets(q
=g
['stuff'])['statuses']
412 printNicely('Newest tweets:')
413 for i
in reversed(xrange(c
['SEARCH_MAX_RECORD'])):
416 keyword
=g
['stuff'].strip()[1:])
419 printNicely(magenta('I\'m afraid there is no result'))
421 printNicely(red('A keyword should be a hashtag (like \'#AKB48\')'))
426 Send a direct message
428 t
= Twitter(auth
=authen())
429 user
= g
['stuff'].split()[0]
430 if user
[0].startswith('@'):
432 content
= g
['stuff'].split()[1]
434 printNicely(red('Sorry I can\'t understand.'))
435 t
.direct_messages
.new(
436 screen_name
=user
[1:],
439 printNicely(green('Message sent.'))
441 printNicely(red('A name should begin with a \'@\''))
448 t
= Twitter(auth
=authen())
450 target
= g
['stuff'].split()[0]
451 if target
!= 'image':
453 id = int(g
['stuff'].split()[1])
454 tid
= db
.rainbow_to_tweet_query(id)[0].tweet_id
455 tweet
= t
.statuses
.show(id=tid
)
456 media
= tweet
['entities']['media']
458 res
= requests
.get(m
['media_url'])
459 img
= Image
.open(StringIO(res
.content
))
462 printNicely(red('Sorry I can\'t show this image.'))
467 List friends for followers
469 t
= Twitter(auth
=authen())
472 name
= g
['stuff'].split()[1]
473 if name
.startswith('@'):
476 printNicely(red('A name should begin with a \'@\''))
477 raise Exception('Invalid name')
479 name
= g
['original_name']
480 # Get list followers or friends
482 target
= g
['stuff'].split()[0]
484 printNicely(red('Omg some syntax is wrong.'))
486 d
= {'fl': 'followers', 'fr': 'friends'}
490 while next_cursor
!= 0:
491 list = getattr(t
, d
[target
]).list(
495 include_entities
=False,
497 for u
in list['users']:
498 rel
[u
['name']] = '@' + u
['screen_name']
499 next_cursor
= list['next_cursor']
501 printNicely('All: ' + str(len(rel
)) + ' people.')
503 user
= ' ' + cycle_color(name
) + grey(' ' + rel
[name
] + ' ')
509 Inbox direct messages
511 t
= Twitter(auth
=authen())
512 num
= c
['MESSAGES_DISPLAY']
514 if g
['stuff'].isdigit():
517 # Max message per page is 20 so we have to loop
519 rel
= rel
+ t
.direct_messages(
522 include_entities
=False,
527 rel
= rel
+ t
.direct_messages(
530 include_entities
=False,
534 printNicely('Inbox: newest ' + str(len(rel
)) + ' messages.')
535 for m
in reversed(rel
):
544 t
= Twitter(auth
=authen())
545 num
= c
['MESSAGES_DISPLAY']
547 if g
['stuff'].isdigit():
548 num
= int(g
['stuff'])
550 # Max message per page is 20 so we have to loop
552 rel
= rel
+ t
.direct_messages
.sent(
555 include_entities
=False,
560 rel
= rel
+ t
.direct_messages
.sent(
563 include_entities
=False,
567 printNicely('Sent: newest ' + str(len(rel
)) + ' messages.')
568 for m
in reversed(rel
):
577 t
= Twitter(auth
=authen())
579 rid
= int(g
['stuff'].split()[0])
581 printNicely(red('Sorry I can\'t understand.'))
582 mid
= db
.rainbow_to_message_query(rid
)[0].message_id
583 t
.direct_messages
.destroy(id=mid
)
584 printNicely(green('Message deleted.'))
589 Show profile of a specific user
591 t
= Twitter(auth
=authen())
592 screen_name
= g
['stuff'].split()[0]
593 if screen_name
.startswith('@'):
596 screen_name
=screen_name
[1:],
597 include_entities
=False)
598 show_profile(user
, g
['iot'])
600 printNicely(red('Omg no user.'))
602 printNicely(red('A name should begin with a \'@\''))
609 t
= Twitter(auth
=authen())
610 screen_name
= g
['stuff'].split()[0]
611 if screen_name
.startswith('@'):
612 t
.friendships
.create(screen_name
=screen_name
[1:], follow
=True)
613 printNicely(green('You are following ' + screen_name
+ ' now!'))
615 printNicely(red('A name should begin with a \'@\''))
622 t
= Twitter(auth
=authen())
623 screen_name
= g
['stuff'].split()[0]
624 if screen_name
.startswith('@'):
625 t
.friendships
.destroy(
626 screen_name
=screen_name
[1:],
627 include_entities
=False)
628 printNicely(green('Unfollow ' + screen_name
+ ' success!'))
630 printNicely(red('A name should begin with a \'@\''))
637 t
= Twitter(auth
=authen())
639 screen_name
= g
['stuff'].split()[0]
641 printNicely(red('A name should be specified. '))
643 if screen_name
.startswith('@'):
644 rel
= t
.mutes
.users
.create(screen_name
=screen_name
[1:])
645 if isinstance(rel
, dict):
646 printNicely(green(screen_name
+ ' is muted.'))
648 printNicely(red(rel
))
650 printNicely(red('A name should begin with a \'@\''))
657 t
= Twitter(auth
=authen())
659 screen_name
= g
['stuff'].split()[0]
661 printNicely(red('A name should be specified. '))
663 if screen_name
.startswith('@'):
664 rel
= t
.mutes
.users
.destroy(screen_name
=screen_name
[1:])
665 if isinstance(rel
, dict):
666 printNicely(green(screen_name
+ ' is unmuted.'))
668 printNicely(red(rel
))
670 printNicely(red('A name should begin with a \'@\''))
677 t
= Twitter(auth
=authen())
682 while next_cursor
!= 0:
683 list = t
.mutes
.users
.list(
684 screen_name
=g
['original_name'],
687 include_entities
=False,
689 for u
in list['users']:
690 rel
[u
['name']] = '@' + u
['screen_name']
691 next_cursor
= list['next_cursor']
693 printNicely('All: ' + str(len(rel
)) + ' people.')
695 user
= ' ' + cycle_color(name
) + grey(' ' + rel
[name
] + ' ')
703 t
= Twitter(auth
=authen())
704 screen_name
= g
['stuff'].split()[0]
705 if screen_name
.startswith('@'):
707 screen_name
=screen_name
[1:],
708 include_entities
=False,
710 printNicely(green('You blocked ' + screen_name
+ '.'))
712 printNicely(red('A name should begin with a \'@\''))
719 t
= Twitter(auth
=authen())
720 screen_name
= g
['stuff'].split()[0]
721 if screen_name
.startswith('@'):
723 screen_name
=screen_name
[1:],
724 include_entities
=False,
726 printNicely(green('Unblock ' + screen_name
+ ' success!'))
728 printNicely(red('A name should begin with a \'@\''))
733 Report a user as a spam account
735 t
= Twitter(auth
=authen())
736 screen_name
= g
['stuff'].split()[0]
737 if screen_name
.startswith('@'):
739 screen_name
=screen_name
[1:])
740 printNicely(green('You reported ' + screen_name
+ '.'))
742 printNicely(red('Sorry I can\'t understand.'))
750 rel
= os
.popen('cal').read().split('\n')
752 month
= random_rainbow(month
)
754 date
= ' '.join([cycle_color(i
) for i
in date
.split(' ')])
755 today
= str(int(os
.popen('date +\'%d\'').read().strip()))
760 ary
= line
.split(' ')
761 ary
= map(lambda x
: on_grey(x
) if x
== today
else grey(x
), ary
)
762 printNicely(' '.join(ary
))
767 List and change theme
771 for theme
in g
['themes']:
772 line
= ' ' * 2 + light_yellow('* ' + theme
)
778 new_config
= 'rainbowstream/colorset/' + g
['stuff'] + '.json'
779 new_config
= load_config(new_config
)
780 for nc
in new_config
:
781 c
[nc
] = new_config
[nc
]
784 g
['ascii_art'] = False
786 g
['decorated_name'] = color_func(
787 c
['DECORATED_NAME'])(
788 '[@' + g
['original_name'] + ']: ')
789 printNicely(green('Theme changed.'))
791 printNicely(red('Sorry, config file is broken!'))
799 h
, w
= os
.popen('stty size', 'r').read().split()
803 usage
+= s
+ 'Hi boss! I\'m ready to serve you right now!\n'
804 usage
+= s
+ '-' * (int(w
) - 4) + '\n'
805 usage
+= s
+ 'You are ' + \
806 light_yellow('already') + ' on your personal stream.\n'
807 usage
+= s
+ 'Any update from Twitter will show up ' + \
808 light_yellow('immediately') + '.\n'
809 usage
+= s
+ 'In addtion, following commands are available right now:\n'
813 usage
+= s
+ grey(u
'\u266A' + ' Discover the world \n')
814 usage
+= s
* 2 + light_green('trend') + ' will show global trending topics. ' + \
815 'You can try ' + light_green('trend US') + ' or ' + \
816 light_green('trend JP Tokyo') + '.\n'
817 usage
+= s
* 2 + light_green('home') + ' will show your timeline. ' + \
818 light_green('home 7') + ' will show 7 tweets.\n'
819 usage
+= s
* 2 + light_green('mentions') + ' will show mentions timeline. ' + \
820 light_green('mentions 7') + ' will show 7 mention tweets.\n'
821 usage
+= s
* 2 + light_green('whois @mdo') + ' will show profile of ' + \
822 magenta('@mdo') + '.\n'
823 usage
+= s
* 2 + light_green('view @mdo') + \
824 ' will show ' + magenta('@mdo') + '\'s home.\n'
825 usage
+= s
* 2 + light_green('s #AKB48') + ' will search for "' + \
826 light_yellow('AKB48') + '" and return 5 newest tweet.\n'
830 usage
+= s
+ grey(u
'\u266A' + ' Tweets \n')
831 usage
+= s
* 2 + light_green('t oops ') + \
832 'will tweet "' + light_yellow('oops') + '" immediately.\n'
834 light_green('rt 12 ') + ' will retweet to tweet with ' + \
835 light_yellow('[id=12]') + '.\n'
837 light_green('allrt 12 20 ') + ' will list 20 newest retweet of the tweet with ' + \
838 light_yellow('[id=12]') + '.\n'
839 usage
+= s
* 2 + light_green('rep 12 oops') + ' will reply "' + \
840 light_yellow('oops') + '" to tweet with ' + \
841 light_yellow('[id=12]') + '.\n'
843 light_green('fav 12 ') + ' will favorite the tweet with ' + \
844 light_yellow('[id=12]') + '.\n'
846 light_green('ufav 12 ') + ' will unfavorite tweet with ' + \
847 light_yellow('[id=12]') + '.\n'
849 light_green('del 12 ') + ' will delete tweet with ' + \
850 light_yellow('[id=12]') + '.\n'
851 usage
+= s
* 2 + light_green('show image 12') + ' will show image in tweet with ' + \
852 light_yellow('[id=12]') + ' in your OS\'s image viewer.\n'
856 usage
+= s
+ grey(u
'\u266A' + ' Direct messages \n')
857 usage
+= s
* 2 + light_green('inbox') + ' will show inbox messages. ' + \
858 light_green('inbox 7') + ' will show newest 7 messages.\n'
859 usage
+= s
* 2 + light_green('sent') + ' will show sent messages. ' + \
860 light_green('sent 7') + ' will show newest 7 messages.\n'
861 usage
+= s
* 2 + light_green('mes @dtvd88 hi') + ' will send a "hi" messege to ' + \
862 magenta('@dtvd88') + '.\n'
863 usage
+= s
* 2 + light_green('trash 5') + ' will remove message with ' + \
864 light_yellow('[message_id=5]') + '.\n'
866 # Follower and following
868 usage
+= s
+ grey(u
'\u266A' + ' Fiends and followers \n')
870 light_green('ls fl') + \
871 ' will list all followers (people who are following you).\n'
873 light_green('ls fr') + \
874 ' will list all friends (people who you are following).\n'
875 usage
+= s
* 2 + light_green('fl @dtvd88') + ' will follow ' + \
876 magenta('@dtvd88') + '.\n'
877 usage
+= s
* 2 + light_green('ufl @dtvd88') + ' will unfollow ' + \
878 magenta('@dtvd88') + '.\n'
879 usage
+= s
* 2 + light_green('mute @dtvd88') + ' will mute ' + \
880 magenta('@dtvd88') + '.\n'
881 usage
+= s
* 2 + light_green('unmute @dtvd88') + ' will unmute ' + \
882 magenta('@dtvd88') + '.\n'
883 usage
+= s
* 2 + light_green('muting') + ' will list muting users.\n'
884 usage
+= s
* 2 + light_green('block @dtvd88') + ' will block ' + \
885 magenta('@dtvd88') + '.\n'
886 usage
+= s
* 2 + light_green('unblock @dtvd88') + ' will unblock ' + \
887 magenta('@dtvd88') + '.\n'
888 usage
+= s
* 2 + light_green('report @dtvd88') + ' will report ' + \
889 magenta('@dtvd88') + ' as a spam account.\n'
893 usage
+= s
+ grey(u
'\u266A' + ' Switching streams \n')
894 usage
+= s
* 2 + light_green('switch public #AKB') + \
895 ' will switch to public stream and follow "' + \
896 light_yellow('AKB') + '" keyword.\n'
897 usage
+= s
* 2 + light_green('switch mine') + \
898 ' will switch to your personal stream.\n'
899 usage
+= s
* 2 + light_green('switch mine -f ') + \
900 ' will prompt to enter the filter.\n'
901 usage
+= s
* 3 + light_yellow('Only nicks') + \
902 ' filter will decide nicks will be INCLUDE ONLY.\n'
903 usage
+= s
* 3 + light_yellow('Ignore nicks') + \
904 ' filter will decide nicks will be EXCLUDE.\n'
905 usage
+= s
* 2 + light_green('switch mine -d') + \
906 ' will use the config\'s ONLY_LIST and IGNORE_LIST.\n'
910 usage
+= s
+ grey(u
'\u266A' + ' Smart shell\n')
911 usage
+= s
* 2 + light_green('111111 * 9 / 7') + ' or any math expression ' + \
912 'will be evaluate by Python interpreter.\n'
913 usage
+= s
* 2 + 'Even ' + light_green('cal') + ' will show the calendar' + \
914 ' for current month.\n'
918 usage
+= s
+ grey(u
'\u266A' + ' Screening \n')
919 usage
+= s
* 2 + light_green('theme') + ' will list available theme.' + \
920 light_green('theme monokai') + ' will apply ' + light_yellow('monokai') + \
921 ' theme immediately.\n'
922 usage
+= s
* 2 + light_green('h') + ' will show this help again.\n'
923 usage
+= s
* 2 + light_green('c') + ' will clear the screen.\n'
924 usage
+= s
* 2 + light_green('q') + ' will quit.\n'
928 usage
+= s
+ '-' * (int(w
) - 4) + '\n'
929 usage
+= s
+ 'Have fun and hang tight! \n'
945 os
.system('rm -rf rainbow.db')
946 os
.kill(g
['stream_pid'], signal
.SIGKILL
)
955 printNicely(magenta('Need tips ? Type "h" and hit Enter key!'))
958 printNicely(eval(g
['cmd']))
1009 Listen to user's input
1014 ['public', 'mine'], # switch
1028 ['image'], # show image
1029 ['fl', 'fr'], # list
1043 g
['themes'], # theme
1049 init_interactive_shell(d
)
1054 line
= raw_input(g
['decorated_name'])
1058 cmd
= line
.split()[0]
1062 # Save cmd to global variable and call process
1064 g
['stuff'] = ' '.join(line
.split()[1:])
1066 except Exception as e
:
1068 printNicely(red('OMG something is wrong with Twitter right now.'))
1069 # Not redisplay prefix
1070 if cmd
in ['switch', 't', 'rt', 'rep']:
1076 def stream(domain
, args
, name
='Rainbow Stream'):
1083 c
['USER_DOMAIN']: name
,
1084 c
['PUBLIC_DOMAIN']: args
.track_keywords
,
1085 c
['SITE_DOMAIN']: 'Site Stream',
1088 ascii_art(art_dict
[domain
])
1090 # These arguments are optional:
1092 timeout
=args
.timeout
,
1093 block
=not args
.no_block
,
1094 heartbeat_timeout
=args
.heartbeat_timeout
)
1098 if args
.track_keywords
:
1099 query_args
['track'] = args
.track_keywords
1102 stream
= TwitterStream(
1107 if domain
== c
['USER_DOMAIN']:
1108 tweet_iter
= stream
.user(**query_args
)
1109 elif domain
== c
['SITE_DOMAIN']:
1110 tweet_iter
= stream
.site(**query_args
)
1112 if args
.track_keywords
:
1113 tweet_iter
= stream
.statuses
.filter(**query_args
)
1115 tweet_iter
= stream
.statuses
.sample()
1117 # Iterate over the stream.
1119 for tweet
in tweet_iter
:
1121 printNicely("-- None --")
1122 elif tweet
is Timeout
:
1123 printNicely("-- Timeout --")
1124 elif tweet
is HeartbeatTimeout
:
1125 printNicely("-- Heartbeat Timeout --")
1126 elif tweet
is Hangup
:
1127 printNicely("-- Hangup --")
1128 elif tweet
.get('text'):
1131 iot
=args
.image_on_term
,
1132 keyword
=args
.track_keywords
,
1138 magenta("I'm afraid we have problem with twitter'S maximum connection."))
1139 printNicely(magenta("Let's try again later."))
1146 # Spawn stream process
1147 args
= parse_arguments()
1148 get_decorated_name()
1154 g
['original_name']))
1157 # Start listen process
1161 g
['stream_pid'] = p
.pid
1162 g
['iot'] = args
.image_on_term