0

I am trying to use the python twitter API but it can't find the Twitter class. https://pypi.python.org/pypi/twitter

For instance I do the following without any errors:

 from twitter import *

But when I do:

 >>> t = Twitter(auth)
 Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 NameError: name 'Twitter' is not defined

What am I missing? Is there a different python twitter library I need to install?

user2399453
  • 2,930
  • 5
  • 33
  • 60

1 Answers1

0

Try using the tweepy library, easy to use. Take a look at http://www.tweepy.org/

Here is a code example:

import tweepy

auth = tweepy.OAuthHandler('','')

auth.set_access_token('', '')

api = tweepy.API(auth)

public_tweets = api.followers_ids()
for tweet in public_tweets:
    print len(public_tweets)