From 1b5bb6edc34a0c0f3b4e3b97a7df8aa709ba9c9e Mon Sep 17 00:00:00 2001 From: Benjamin Mako Hill Date: Mon, 4 May 2015 17:15:57 -0700 Subject: [PATCH] fixed bugs and python3 updates for the twitter projects --- twitter2.py | 2 +- twitter4.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/twitter2.py b/twitter2.py index 89f03fa..6d67a0f 100644 --- a/twitter2.py +++ b/twitter2.py @@ -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) diff --git a/twitter4.py b/twitter4.py index 918b565..3030edf 100644 --- a/twitter4.py +++ b/twitter4.py @@ -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) -- 2.30.2