Skip to content

Extended Text - New Twitter Update #1

Description

@zshancock

Siraj - Love this video! I have never commited, pulled or done any changes to another person's repository so I thought I would leave it here.

When you perform a search using api.search in tweepy, if you run it the way you have specified it will recover the old character limit (140 characters, ends with "..."). I read through the Twitter Dev API documentation and its a pretty easy fix to get the full 280 characters.

Please note, that the behavior of RT/"Retweets" still only returns 140 characters, but still is searching correctly.

Keep up the videos!

Zac

auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)

api = tweepy.API(auth)

tweets = api.search('Artificial Intelligence', count=200, tweet_mode = 'extended')

data = pd.DataFrame(data=[tweet.text full_text for tweet in tweets], columns=['Tweets'])
display(data.head(10))
print(tweets[0].created_at)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions