Rename API.search to API.search_tweets
authorHarmon <Harmon758@gmail.com>
Fri, 28 May 2021 13:49:07 +0000 (08:49 -0500)
committerHarmon <Harmon758@gmail.com>
Fri, 28 May 2021 13:49:07 +0000 (08:49 -0500)
cassettes/testsearchtweets.json [moved from cassettes/testsearch.json with 100% similarity]
docs/api.rst
docs/auth_tutorial.rst
docs/pagination.rst
tests/test_api.py
tweepy/api.py

index 4e631e63deea2d8f973d87bc1be359265441de59..c9a303f218f4e0946eb890f3c8019f2b0be2f49e 100644 (file)
@@ -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
 ==================
index 29cac52e829bd1f5f92a3b62fdb84536b205e573..8a22a618e111efcd87ecdf508ef1b87b3467eea0 100644 (file)
@@ -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
index e32413e615c6c746a373da9e06ccf01e4dd9c722..f752ace60f9f9e6bf9eb34bf78e35bae9a204832 100644 (file)
@@ -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",
index 2a2039c3b07ea9a9a07ab528519ae312dd91e3e3..20e2f2ad1078603bbc4664045ceb73e039585f53 100644 (file)
@@ -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):
index 0f04d84b16e9082a4677da42c3d779ef78a63cfe..9446eac4326602f78bfa8e32be799f110d7f7476 100644 (file)
@@ -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.