From: Patrick A. Levell Date: Wed, 14 Nov 2018 18:38:21 +0000 (-0500) Subject: Added tweet_mode support to lookup_users() in tweepy/api.py X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=279642f4bb37cd694530f5d7716f87e61714d553;p=tweepy.git Added tweet_mode support to lookup_users() in tweepy/api.py --- diff --git a/CONTRIBUTORS b/CONTRIBUTORS index edaee86..77342ad 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -35,3 +35,4 @@ Kohei YOSHIDA Mark Smith (@judy2k) Steven Skoczen (@skoczen) Samuel (@obskyr) +Patrick A. Levell (@palevell) diff --git a/tweepy/api.py b/tweepy/api.py index b627f07..e719176 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -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):