fixed bugs and python3 updates for the twitter projects
authorBenjamin Mako Hill <mako@atdot.cc>
Tue, 5 May 2015 00:15:57 +0000 (17:15 -0700)
committerBenjamin Mako Hill <mako@atdot.cc>
Tue, 5 May 2015 00:15:57 +0000 (17:15 -0700)
twitter2.py
twitter4.py

index 89f03fa..6d67a0f 100644 (file)
@@ -13,6 +13,6 @@ print(user.screen_name + " has " + str(user.followers_count) + " followers.")
 
 print("They include these 100 people:")
 
-for friend in user.friends(count=100):
+for friend in user.followers(count=100):
    print(friend.screen_name)
 
index 918b565..3030edf 100644 (file)
@@ -8,8 +8,7 @@ auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
 api = tweepy.API(auth)
 
 # code to write the file
-import codecs
-output_file = codecs.open("MY_DATA.tsv", "w", "utf-8")
+output_file = open("MY_DATA.tsv", "w", encoding="utf-8")
 
 public_tweets = api.search("data science", count=10)
 

Benjamin Mako Hill || Want to submit a patch?