Commit c060f7b3 authored by Joshua Roesslein's avatar Joshua Roesslein
Browse files

Merge pull request #250 from santosh/master

Changed all Tabs to Spaces
parents 24d97c03 df4044c9
...@@ -2,7 +2,7 @@ from tweepy.streaming import StreamListener ...@@ -2,7 +2,7 @@ from tweepy.streaming import StreamListener
from tweepy import OAuthHandler from tweepy import OAuthHandler
from tweepy import Stream from tweepy import Stream
# Go to http://dev.twitter.com and create an app. # Go to http://dev.twitter.com and create an app.
# The consumer key and secret will be generated for you after # The consumer key and secret will be generated for you after
consumer_key="" consumer_key=""
consumer_secret="" consumer_secret=""
...@@ -13,21 +13,21 @@ access_token="" ...@@ -13,21 +13,21 @@ access_token=""
access_token_secret="" access_token_secret=""
class StdOutListener(StreamListener): class StdOutListener(StreamListener):
""" A listener handles tweets are the received from the stream. """ A listener handles tweets are the received from the stream.
This is a basic listener that just prints received tweets to stdout. This is a basic listener that just prints received tweets to stdout.
""" """
def on_data(self, data): def on_data(self, data):
print data print data
return True return True
def on_error(self, status): def on_error(self, status):
print status print status
if __name__ == '__main__': if __name__ == '__main__':
l = StdOutListener() l = StdOutListener()
auth = OAuthHandler(consumer_key, consumer_secret) auth = OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret) auth.set_access_token(access_token, access_token_secret)
stream = Stream(auth, l) stream = Stream(auth, l)
stream.filter(track=['basketball']) stream.filter(track=['basketball'])
...@@ -260,7 +260,7 @@ class API(object): ...@@ -260,7 +260,7 @@ class API(object):
""" Perform bulk look up of friendships from user ID or screenname """ """ Perform bulk look up of friendships from user ID or screenname """
def lookup_friendships(self, user_ids=None, screen_names=None): def lookup_friendships(self, user_ids=None, screen_names=None):
return self._lookup_friendships(list_to_csv(user_ids), list_to_csv(screen_names)) return self._lookup_friendships(list_to_csv(user_ids), list_to_csv(screen_names))
_lookup_friendships = bind_api( _lookup_friendships = bind_api(
path = '/friendships/lookup.json', path = '/friendships/lookup.json',
......
...@@ -138,9 +138,9 @@ class OAuthHandler(AuthHandler): ...@@ -138,9 +138,9 @@ class OAuthHandler(AuthHandler):
oauth_consumer=self._consumer, oauth_consumer=self._consumer,
http_method='POST', http_url=url, http_method='POST', http_url=url,
parameters = { parameters = {
'x_auth_mode': 'client_auth', 'x_auth_mode': 'client_auth',
'x_auth_username': username, 'x_auth_username': username,
'x_auth_password': password 'x_auth_password': password
} }
) )
request.sign_request(self._sigmethod, self._consumer, None) request.sign_request(self._sigmethod, self._consumer, None)
......
...@@ -315,7 +315,7 @@ class Relationship(Model): ...@@ -315,7 +315,7 @@ class Relationship(Model):
result = cls(api) result = cls(api)
for k,v in json.items(): for k,v in json.items():
if k == 'connections': if k == 'connections':
setattr(result, 'is_following', 'following' in v) setattr(result, 'is_following', 'following' in v)
setattr(result, 'is_followed_by', 'followed_by' in v) setattr(result, 'is_followed_by', 'followed_by' in v)
else: else:
setattr(result, k, v) setattr(result, k, v)
......
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