From: Harmon Date: Fri, 28 May 2021 13:49:07 +0000 (-0500) Subject: Rename API.search to API.search_tweets X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=7fac25379d51174408f0a361c22d8649437a0255;p=tweepy.git Rename API.search to API.search_tweets --- diff --git a/cassettes/testsearch.json b/cassettes/testsearchtweets.json similarity index 100% rename from cassettes/testsearch.json rename to cassettes/testsearchtweets.json diff --git a/docs/api.rst b/docs/api.rst index 4e631e6..c9a303f 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -64,7 +64,7 @@ +------------------------------------------+--------------------------------------+ | .. centered:: |Search Tweets|_ | +------------------------------------------+--------------------------------------+ - | `GET search/tweets`_ | :meth:`API.search` | + | `GET search/tweets`_ | :meth:`API.search_tweets` | +------------------------------------------+--------------------------------------+ | .. centered:: :ref:`Accounts and users` | +------------------------------------------+--------------------------------------+ @@ -421,7 +421,7 @@ Post, retrieve, and engage with Tweets Search Tweets ------------- -.. automethod:: API.search +.. automethod:: API.search_tweets Accounts and users ================== diff --git a/docs/auth_tutorial.rst b/docs/auth_tutorial.rst index 29cac52..8a22a61 100644 --- a/docs/auth_tutorial.rst +++ b/docs/auth_tutorial.rst @@ -144,5 +144,5 @@ key and secret:: With the bearer token received, we are now ready for business:: api = tweepy.API(auth) - for tweet in tweepy.Cursor(api.search, q='tweepy').items(10): + for tweet in tweepy.Cursor(api.search_tweets, q='tweepy').items(10): print(tweet.text) \ No newline at end of file diff --git a/docs/pagination.rst b/docs/pagination.rst index e32413e..f752ace 100644 --- a/docs/pagination.rst +++ b/docs/pagination.rst @@ -22,7 +22,8 @@ Example auth = tweepy.AppAuthHandler("Consumer Key here", "Consumer Secret here") api = tweepy.API(auth) - for status in tweepy.Cursor(api.search, "Tweepy", count=100).items(250): + for status in tweepy.Cursor(api.search_tweets, "Tweepy", + count=100).items(250): print(status.id) for page in tweepy.Cursor(api.followers, screen_name="TwitterDev", diff --git a/tests/test_api.py b/tests/test_api.py index 2a2039c..20e2f2a 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -355,9 +355,9 @@ class TweepyAPITests(TweepyTestCase): self.assertEqual(self.api.get_saved_search(s.id).query, 'test') self.api.destroy_saved_search(s.id) - @tape.use_cassette('testsearch.json') - def testsearch(self): - self.api.search('tweepy') + @tape.use_cassette('testsearchtweets.json') + def testsearchtweets(self): + self.api.search_tweets('tweepy') @tape.use_cassette('testgeoapis.json') def testgeoapis(self): diff --git a/tweepy/api.py b/tweepy/api.py index 0f04d84..9446eac 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -1190,9 +1190,9 @@ class API: @pagination(mode='id') @payload('search_results') - def search(self, q, **kwargs): - """search(q, *, geocode, lang, locale, result_type, count, until, \ - since_id, max_id, include_entities) + def search_tweets(self, q, **kwargs): + """search_tweets(q, *, geocode, lang, locale, result_type, count, \ + until, since_id, max_id, include_entities) Returns a collection of relevant Tweets matching a specified query.