Added tweet_mode support to lookup_users() in tweepy/api.py
authorPatrick A. Levell <patrick.a.levell@gmail.com>
Wed, 14 Nov 2018 18:38:21 +0000 (13:38 -0500)
committerPatrick A. Levell <patrick.a.levell@gmail.com>
Wed, 14 Nov 2018 18:38:21 +0000 (13:38 -0500)
CONTRIBUTORS
tweepy/api.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 b627f0764da277ed166c381e9b83a46c4b12698f..e719176896098acbfb0506fc1228dd257df6d6f8 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://dev.twitter.com/rest/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):