Commit 56ee0eb0 authored by Mark Smith's avatar Mark Smith
Browse files

Updated examples to work in Python 3.

parent 615dd86a
from __future__ import absolute_import, print_function
import tweepy
# == OAuth Authentication ==
......@@ -11,7 +13,7 @@ consumer_key=""
# The access tokens can be found on your applications's Details
# page located at (located
# page located at (located
# under "Your access token")
......@@ -24,9 +26,9 @@ api = tweepy.API(auth)
# If the authentication was successful, you should
# see the name of the account print out
# 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
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
return True
def on_error(self, 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