Commit 051075df authored by Aaron1011's avatar Aaron1011
Browse files

Merge pull request #509 from judy2k/fix-examples

Updated examples to work in Python 3.
parents 78aebf98 56ee0eb0
from __future__ import absolute_import, print_function
import tweepy
# == OAuth Authentication ==
......@@ -11,7 +13,7 @@ consumer_key=""
consumer_secret=""
# The access tokens can be found on your applications's Details
# page located at https://dev.twitter.com/apps (located
# page located at https://dev.twitter.com/apps (located
# under "Your access token")
access_token=""
access_token_secret=""
......@@ -24,9 +26,9 @@ api = tweepy.API(auth)
# If the authentication was successful, you should
# see the name of the account print out
print api.me().name
print(api.me().name)
# If the application settings are set for "Read and Write" then
# this line should tweet out the message to your account's
# this line should tweet out the message to your account's
# timeline. The "Read and Write" setting is on https://dev.twitter.com/apps
api.update_status('Updating using OAuth authentication via Tweepy!')
from __future__ import absolute_import, print_function
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
......@@ -18,11 +20,11 @@ class StdOutListener(StreamListener):
"""
def on_data(self, data):
print data
print(data)
return True
def on_error(self, status):
print status
print(status)
if __name__ == '__main__':
l = StdOutListener()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment