Post, retrieve, and engage with Tweets
--------------------------------------
+.. automethod:: API.favorites
+
.. method:: API.statuses_lookup(id_, [include_entities], [trim_user], [map_], \
[include_ext_alt_text], [include_card_uri])
Favorite Methods
----------------
-.. method:: API.favorites([id], [page])
-
- Returns the favorite statuses for the authenticating user or user specified
- by the ID parameter.
-
- :param id: The ID or screen name of the user to request favorites
- :param page: |page|
- :rtype: list of :class:`Status` objects
-
-
.. method:: API.create_favorite(id)
Favorites the status specified in the ID parameter as the authenticating
# Post, retrieve, and engage with Tweets
+ @pagination(mode='id')
+ @payload('status', list=True)
+ def favorites(self, **kwargs):
+ """favorites(*, user_id, screen_name, count, since_id, max_id, \
+ include_entities)
+
+ Returns the favorite statuses for the authenticating user or user
+ specified by the ID parameter.
+
+ :param user_id: |user_id|
+ :param screen_name: |screen_name|
+ :param count: |count|
+ :param since_id: |since_id|
+ :param max_id: |max_id|
+ :param include_entities: |include_entities|
+
+ :rtype: list of :class:`Status` objects
+
+ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-favorites-list
+ """
+ return self.request(
+ 'GET', 'favorites/list', endpoint_parameters=(
+ 'user_id', 'screen_name', 'count', 'since_id', 'max_id',
+ 'include_entities'
+ ), **kwargs
+ )
+
@payload('status', list=True)
def statuses_lookup(self, id, **kwargs):
""" :reference: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-lookup
), **kwargs
)
- @pagination(mode='id')
- @payload('status', list=True)
- def favorites(self, **kwargs):
- """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-favorites-list
- """
- return self.request(
- 'GET', 'favorites/list', endpoint_parameters=(
- 'user_id', 'screen_name', 'count', 'since_id', 'max_id',
- 'include_entities'
- ), **kwargs
- )
-
@payload('status')
def create_favorite(self, id, **kwargs):
""" :reference: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-favorites-create