equal
deleted
inserted
replaced
29 |
29 |
30 |
30 |
31 return parser.parse_args() |
31 return parser.parse_args() |
32 |
32 |
33 if __name__ == "__main__": |
33 if __name__ == "__main__": |
34 |
34 |
35 sys.stdout = codecs.getwriter(sys.stdout.encoding)(sys.stdout) |
|
36 |
|
37 options = get_option() |
35 options = get_option() |
38 |
36 |
39 access_token = None |
37 access_token = None |
40 if options.query_user: |
38 if options.query_user: |
41 access_token = get_oauth_token(options.token_filename) |
39 access_token = get_oauth_token(options.token_filename) |
89 tp = TwitterProcessor(None, tweet_source, None, session_tgt, access_token, options.token_filename, user_query_twitter=options.query_user) |
87 tp = TwitterProcessor(None, tweet_source, None, session_tgt, access_token, options.token_filename, user_query_twitter=options.query_user) |
90 tp.process() |
88 tp.process() |
91 |
89 |
92 session_tgt.flush() |
90 session_tgt.flush() |
93 |
91 |
94 show_progress(i+1, count_tw, progress_text+tweet.text, 70) |
92 ptext = progress_text + tweet.text |
|
93 show_progress(i+1, count_tw, ptext.replace("\n",""), 70) |
95 |
94 |
96 session_tgt.commit() |
95 session_tgt.commit() |
97 print u"%d new tweet added" % (added) |
96 print u"%d new tweet added" % (added) |
98 |
97 |
99 finally: |
98 finally: |