--- /dev/null
+interactions:
+- request:
+ body: null
+ headers:
+ Accept:
+ - '*/*'
+ Accept-Encoding:
+ - gzip, deflate
+ Connection:
+ - keep-alive
+ User-Agent:
+ - Python/3.10.0 Requests/2.27.1 Tweepy/4.4.0
+ method: GET
+ uri: https://api.twitter.com/2/users/me
+ response:
+ body:
+ string: !!binary |
+ H4sIAAAAAAAAAKpWSkksSVSyqlbKTFGyUjI0MDcyMjUwNTYyMzG1tLQwtTRT0lHKS8xNBUqGlKem
+ FlQqhKQWl2TmpQPFS4tTi1DkXFLLlGprAQAAAP//AwBsn+W8VAAAAA==
+ headers:
+ api-version:
+ - '2.32'
+ cache-control:
+ - no-cache, no-store, max-age=0
+ content-disposition:
+ - attachment; filename=json.json
+ content-encoding:
+ - gzip
+ content-length:
+ - '97'
+ content-type:
+ - application/json; charset=utf-8
+ date:
+ - Fri, 07 Jan 2022 08:05:56 UTC
+ server:
+ - tsa_b
+ set-cookie:
+ - guest_id_marketing=v1%3A164154275647329260; Max-Age=63072000; Expires=Sun,
+ 07 Jan 2024 08:05:56 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None
+ - guest_id_ads=v1%3A164154275647329260; Max-Age=63072000; Expires=Sun, 07 Jan
+ 2024 08:05:56 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None
+ - personalization_id="v1_ihenaUbNvkcvFbDMb0HZ4g=="; Max-Age=63072000; Expires=Sun,
+ 07 Jan 2024 08:05:56 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None
+ - guest_id=v1%3A164154275647329260; Max-Age=63072000; Expires=Sun, 07 Jan 2024
+ 08:05:56 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None
+ strict-transport-security:
+ - max-age=631138519
+ x-access-level:
+ - read-write-directmessages
+ x-connection-hash:
+ - 387c0d90998be5164939411741317edc2ba8d97f40d6722aeac473c4a50c6d58
+ x-content-type-options:
+ - nosniff
+ x-frame-options:
+ - SAMEORIGIN
+ x-rate-limit-limit:
+ - '75'
+ x-rate-limit-remaining:
+ - '74'
+ x-rate-limit-reset:
+ - '1641543656'
+ x-response-time:
+ - '36'
+ x-xss-protection:
+ - '0'
+ status:
+ code: 200
+ message: OK
+version: 1
+--------------------------------------------------------------+----------------------------------------+
| `GET /2/users/by`_ | :meth:`Client.get_users` |
+--------------------------------------------------------------+----------------------------------------+
+ | `GET /2/users/me`_ | :meth:`Client.get_me` |
+ +--------------------------------------------------------------+----------------------------------------+
| .. centered:: :ref:`Spaces` |
+-------------------------------------------------------------------------------------------------------+
| .. centered:: |Search Spaces|_ |
.. _GET /2/users/by/username/:username: https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-by-username-username
.. _GET /2/users: https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users
.. _GET /2/users/by: https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-by
+.. _GET /2/users/me: https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-me
.. |Search Spaces| replace:: *Search Spaces*
.. _GET /2/spaces/search: https://developer.twitter.com/en/docs/twitter-api/spaces/search/api-reference/get-spaces-search
.. |Spaces lookup| replace:: *Spaces lookup*
.. automethod:: Client.get_users
+.. automethod:: Client.get_me
+
Spaces
======
def test_get_users(self):
self.client.get_users(usernames=["Twitter", "TwitterDev"])
+ @tape.use_cassette("test_get_me.yaml", serializer="yaml")
+ def test_get_me(self):
+ self.client.get_me(user_auth=True)
+
@tape.use_cassette("test_search_spaces.yaml", serializer="yaml")
def test_search_spaces(self):
self.client.search_spaces("Twitter")