Merge branch 'master' into twitter-devs-references-update
authorHarmon <Harmon758@gmail.com>
Wed, 28 Nov 2018 08:14:17 +0000 (02:14 -0600)
committerHarmon <Harmon758@gmail.com>
Mon, 4 Feb 2019 06:29:27 +0000 (00:29 -0600)
CONTRIBUTORS
docs/cursor_tutorial.rst
tweepy/__init__.py
tweepy/api.py
tweepy/streaming.py

index edaee869d3c05df75da2181ddf7b2c8bfa1fecd2..77342ad264c05f19a454fa22ccc2d5b63098a973 100644 (file)
@@ -35,3 +35,4 @@ Kohei YOSHIDA
 Mark Smith (@judy2k)
 Steven Skoczen (@skoczen)
 Samuel (@obskyr)
+Patrick A. Levell (@palevell)
index aeeea9f494c1a4943895e50c8bddba0043fcf745..4d2741c9b32f96361f5170f07562ac7e1c9ad00a 100644 (file)
@@ -19,7 +19,7 @@ require less code Tweepy has the Cursor object.
 Old way vs Cursor way
 ---------------------
 
-First let's demonstrate iterating the statues in the authenticated
+First let's demonstrate iterating the statuses in the authenticated
 user's timeline. Here is how we would do it the "old way" before
 Cursor object was introduced::
 
index 2071547b0c05084d3696033f7d1bac7ffa2862e9..0ab171f9d233a7f5f919ffab7599b93c34be673d 100644 (file)
@@ -5,7 +5,7 @@
 """
 Tweepy Twitter API library
 """
-__version__ = '3.6.0'
+__version__ = '3.7.0'
 __author__ = 'Joshua Roesslein'
 __license__ = 'MIT'
 
index 2d0feb01584680a2cce47f4866ba8ebaa7dc70a3..baf0d541faccc639ad3102d9ae69199aac2aa126 100644 (file)
@@ -323,8 +323,8 @@ class API(object):
             allowed_param=['id', 'url', 'maxwidth', 'hide_media', 'omit_script', 'align', 'related', 'lang']
         )
 
-    def lookup_users(self, user_ids=None, screen_names=None, include_entities=None):
-        """ Perform bulk look up of users from user ID or screenname """
+    def lookup_users(self, user_ids=None, screen_names=None, include_entities=None, tweet_mode=None):
+        """ Perform bulk look up of users from user ID or screen_name """
         post_data = {}
         if include_entities is not None:
             include_entities = 'true' if include_entities else 'false'
@@ -333,20 +333,22 @@ class API(object):
             post_data['user_id'] = list_to_csv(user_ids)
         if screen_names:
             post_data['screen_name'] = list_to_csv(screen_names)
+        if tweet_mode:
+            post_data['tweet_mode'] = tweet_mode
 
         return self._lookup_users(post_data=post_data)
 
     @property
     def _lookup_users(self):
         """ :reference: https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-users-lookup
-            allowed_param='user_id', 'screen_name', 'include_entities'
+            allowed_param='user_id', 'screen_name', 'include_entities', 'tweet_mode'
         """
         return bind_api(
             api=self,
             path='/users/lookup.json',
             payload_type='user', payload_list=True,
             method='POST',
-            allowed_param=['user_id', 'screen_name', 'include_entities']
+            allowed_param=['user_id', 'screen_name', 'include_entities', 'tweet_mode']
         )
 
     def me(self):
index 7896d58b46abaa39e2fdc4d33b8c949d0ed88677..9f09a974053265176c9a4754c7999dac4ade2733 100644 (file)
@@ -189,8 +189,6 @@ class ReadBuffer(object):
 
 class Stream(object):
 
-    host = 'stream.twitter.com'
-
     def __init__(self, auth, listener, **options):
         self.auth = auth
         self.listener = listener
@@ -223,6 +221,7 @@ class Stream(object):
         
         # Example: proxies = {'http': 'http://localhost:1080', 'https': 'http://localhost:1080'}
         self.proxies = options.get("proxies")
+        self.host = options.get('host', 'stream.twitter.com')
 
     def new_session(self):
         self.session = requests.Session()
@@ -451,7 +450,6 @@ class Stream(object):
         if filter_level:
             self.body['filter_level'] = filter_level.encode(encoding)
         self.session.params = {'delimited': 'length'}
-        self.host = 'stream.twitter.com'
         self._start(is_async)
 
     def sitestream(self, follow, stall_warnings=False,