From ef95d9c8ef5fd4b422a0f20104460dc6611c57b9 Mon Sep 17 00:00:00 2001 From: Joshua Roesslein Date: Mon, 16 Nov 2009 20:32:41 -0600 Subject: [PATCH] Add users search API method. API.search_users(). --- CHANGELOG | 6 +++++- tests.py | 3 +++ tweepy/api.py | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 6148f6f..1c74825 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,11 @@ All changes made to the library that might affect applications during upgrade will be listed here. -1.2 -> 1.3 +1.3 -> 1.4 [Future release] +=========================== ++ Added people search API method. API.search_users() + +1.2 -> 1.3 [Current release] ===================== + Lists API methods added + API.verify_credentials() now returns an User object if credentials diff --git a/tests.py b/tests.py index c76dd64..456de5e 100644 --- a/tests.py +++ b/tests.py @@ -57,6 +57,9 @@ class TweepyAPITests(unittest.TestCase): u = self.api.get_user(783214) self.assertEqual(u.screen_name, 'twitter') + def testsearchusers(self): + self.api.search_users('twitter') + def testme(self): me = self.api.me() self.assertEqual(me.screen_name, username) diff --git a/tweepy/api.py b/tweepy/api.py index 7b332f5..98e3b66 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -146,6 +146,14 @@ class API(object): def me(self): return self.get_user(screen_name=self.auth.get_username()) + """ users/search """ + search_users = bind_api( + path = '/users/search.json', + parser = parse_users, + require_auth = True, + allowed_param = ['q', 'per_page', 'page'] + ) + """ statuses/friends """ friends = bind_api( path = '/statuses/friends.json', -- 2.25.1