Last active
August 29, 2015 14:24
-
-
Save SemanticallyNull/7d48552e5f9b865e6a31 to your computer and use it in GitHub Desktop.
This will dig out the first tweet in the chain.
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
# coding=utf-8 | |
import tweepy | |
# == OAuth Authentication == | |
# | |
# This mode of authentication is the new preferred way | |
# of authenticating with Twitter. | |
# The consumer keys can be found on your application's Details | |
# page located at https://dev.twitter.com/apps (under "OAuth settings") | |
consumer_key="" | |
consumer_secret="" | |
# The access tokens can be found on your applications's Details | |
# page located at https://dev.twitter.com/apps (located | |
# under "Your access token") | |
access_token="" | |
access_token_secret="" | |
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) | |
auth.secure = True | |
auth.set_access_token(access_token, access_token_secret) | |
api = tweepy.API(auth) | |
# Put in your status ID here | |
status_id = '' | |
i = 1 | |
while status_id: | |
status = api.get_status(status_id) | |
print "%d) @%s: %s" % (i, status.user.screen_name, status.text) | |
if hasattr(status, 'quoted_status_id_str'): | |
status_id = status.quoted_status_id_str | |
i += 1 | |
else: | |
status_id = False | |
print "%d tweets deep by @%s: %s" % (i, status.user.screen_name, status.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment