File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -22,23 +22,23 @@ def twitter():
22
22
print
23
23
print "If you did your registration correctly, you can see some numbers"
24
24
print "(If not, maybe you had not chosen client type during Twitter OAuth registration)"
25
- print
25
+ print
26
26
tw = OAuthApi (CONSUMER_KEY , CONSUMER_SECRET , request_token )
27
27
oauth_verifier = raw_input ("What is the number(PIN)? " )
28
28
access_token = tw .getAccessTokenWithPin (oauth_verifier )
29
29
print "Finished setting OAuth configuration."
30
30
print "Now, you can use OAuth. Enjoy!"
31
-
31
+
32
32
pickle .dump (access_token , file (KEY_FILE_API , "w" ))
33
33
return OAuthApi (CONSUMER_KEY , CONSUMER_SECRET , access_token )
34
34
35
35
def main (args ):
36
36
tw = twitter ()
37
37
if len (args ) < 2 :
38
38
for status in tw .GetFriendsTimeline (count = 20 ):
39
- print status .GetUser ().GetScreenName () + ":" , status .GetText (). encode ( "cp932" , "replace" )
39
+ print status .GetUser ().GetScreenName () + ":" , status .GetText ()
40
40
else :
41
41
post = " " .join (args [1 :])
42
- tw .PostUpdate (post . decode ( "cp932" ). encode ( "utf-8" ) )
42
+ tw .PostUpdate (post )
43
43
44
44
if __name__ == "__main__" : main (sys .argv )
You can’t perform that action at this time.
0 commit comments