From 4b87301e0a4b83c36eb4356e6d3c2d5e930ff250 Mon Sep 17 00:00:00 2001 From: kk6 Date: Sat, 9 Mar 2013 20:57:04 +0900 Subject: [PATCH] added multiple list members operatio api methods --- tests.py | 13 +++++++++++++ tweepy/api.py | 16 ++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/tests.py b/tests.py index 20d4a1b..5fb7772 100644 --- a/tests.py +++ b/tests.py @@ -277,6 +277,19 @@ class TweepyAPITests(unittest.TestCase): assert_list(self.api.add_list_member(**params)) assert_list(self.api.remove_list_member(**params)) + def testaddremovelistmembers(self): + params = { + 'slug': 'test', + 'owner_screen_name': username, + 'screen_name': 'twitterapi,twittermobile' + } + + def assert_list(l): + self.assertEqual(l.name, params['slug']) + + assert_list(self.api.add_list_members(**params)) + assert_list(self.api.remove_list_members(**params)) + def testlistmembers(self): self.api.list_members('applepie', 'stars') diff --git a/tweepy/api.py b/tweepy/api.py index b0fbb90..8464090 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -574,6 +574,22 @@ class API(object): require_auth = True ) + add_list_members = bind_api( + path = '/lists/members/create_all.json', + method = 'POST', + payload_type = 'list', + allowed_param = ['screen_name', 'user_id', 'owner_screen_name', 'owner_id', 'slug', 'list_id'], + require_auth = True + ) + + remove_list_members = bind_api( + path = '/lists/members/destroy_all.json', + method = 'POST', + payload_type = 'list', + allowed_param = ['screen_name', 'user_id', 'owner_screen_name', 'owner_id', 'slug', 'list_id'], + require_auth = True + ) + list_members = bind_api( path = '/lists/members.json', payload_type = 'user', payload_list = True, -- 2.25.1