Created
October 9, 2017 23:21
-
-
Save scottythered/0eb069181e1f0a503d0bb4ecaa9823fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tweepy import OAuthHandler | |
from tweepy import API | |
import json | |
from time import sleep | |
consumer_key="xxxxxxxxxxxxxxxxxxxxxxxxx" | |
consumer_secret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | |
access_token="xxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | |
access_token_secret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | |
auth = OAuthHandler(consumer_key, consumer_secret) | |
auth.set_access_token(access_token, access_token_secret) | |
api = API(auth) | |
json_input = open('[JSON file]') | |
data = json.load(json_input) | |
tweets = data["tweets"] | |
for tweet in tweets: | |
api.update_status(tweet) | |
sleep(1800) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment