Skip to content

Instantly share code, notes, and snippets.

@scottythered
Created October 9, 2017 23:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottythered/0eb069181e1f0a503d0bb4ecaa9823fa to your computer and use it in GitHub Desktop.
Save scottythered/0eb069181e1f0a503d0bb4ecaa9823fa to your computer and use it in GitHub Desktop.
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