Commit 17f73ed2 authored by Aaron Hill's avatar Aaron Hill Committed by GitHub
Browse files

Merge pull request #761 from pilbot/feat-140-char-limit

Adds `auto_populate_reply_metadata` attribute on status endpoints
parents 91ee3a97 7ef701be
...@@ -98,13 +98,14 @@ Status methods ...@@ -98,13 +98,14 @@ Status methods
:rtype: :class:`Status` object :rtype: :class:`Status` object
.. method:: API.update_status(status, [in_reply_to_status_id], [lat], [long], [source], [place_id]) .. method:: API.update_status(status, [in_reply_to_status_id], [auto_populate_reply_metadata], [lat], [long], [source], [place_id])
Update the authenticated user's status. Statuses that are duplicates Update the authenticated user's status. Statuses that are duplicates
or too long will be silently ignored. or too long will be silently ignored.
:param status: The text of your status update. :param status: The text of your status update.
:param in_reply_to_status_id: The ID of an existing status that the update is in reply to. :param in_reply_to_status_id: The ID of an existing status that the update is in reply to.
:param auto_populate_reply_metadata: Whether to automatically include the @mentions in the status metadata.
:param lat: The location's latitude that this tweet refers to. :param lat: The location's latitude that this tweet refers to.
:param long: The location's longitude that this tweet refers to. :param long: The location's longitude that this tweet refers to.
:param source: Source of the update. Only supported by Identi.ca. Twitter ignores this parameter. :param source: Source of the update. Only supported by Identi.ca. Twitter ignores this parameter.
...@@ -112,7 +113,7 @@ Status methods ...@@ -112,7 +113,7 @@ Status methods
:rtype: :class:`Status` object :rtype: :class:`Status` object
.. method:: API.update_with_media(filename, [status], [in_reply_to_status_id], [lat], [long], [source], [place_id], [file]) .. method:: API.update_with_media(filename, [status], [in_reply_to_status_id], [auto_populate_reply_metadata], [lat], [long], [source], [place_id], [file])
Update the authenticated user's status. Statuses that are duplicates Update the authenticated user's status. Statuses that are duplicates
or too long will be silently ignored. or too long will be silently ignored.
...@@ -120,6 +121,7 @@ Status methods ...@@ -120,6 +121,7 @@ Status methods
:param filename: The filename of the image to upload. This will automatically be opened unless `file` is specified :param filename: The filename of the image to upload. This will automatically be opened unless `file` is specified
:param status: The text of your status update. :param status: The text of your status update.
:param in_reply_to_status_id: The ID of an existing status that the update is in reply to. :param in_reply_to_status_id: The ID of an existing status that the update is in reply to.
:param auto_populate_reply_metadata: Whether to automatically include the @mentions in the status metadata.
:param lat: The location's latitude that this tweet refers to. :param lat: The location's latitude that this tweet refers to.
:param long: The location's longitude that this tweet refers to. :param long: The location's longitude that this tweet refers to.
:param source: Source of the update. Only supported by Identi.ca. Twitter ignores this parameter. :param source: Source of the update. Only supported by Identi.ca. Twitter ignores this parameter.
......
...@@ -177,7 +177,7 @@ class API(object): ...@@ -177,7 +177,7 @@ class API(object):
def update_status(self, *args, **kwargs): def update_status(self, *args, **kwargs):
""" :reference: https://dev.twitter.com/rest/reference/post/statuses/update """ :reference: https://dev.twitter.com/rest/reference/post/statuses/update
:allowed_param:'status', 'in_reply_to_status_id', 'in_reply_to_status_id_str', 'lat', 'long', 'source', 'place_id', 'display_coordinates', 'media_ids' :allowed_param:'status', 'in_reply_to_status_id', 'in_reply_to_status_id_str', 'auto_populate_reply_metadata', 'lat', 'long', 'source', 'place_id', 'display_coordinates', 'media_ids'
""" """
post_data = {} post_data = {}
media_ids = kwargs.pop("media_ids", None) media_ids = kwargs.pop("media_ids", None)
...@@ -189,7 +189,7 @@ class API(object): ...@@ -189,7 +189,7 @@ class API(object):
path='/statuses/update.json', path='/statuses/update.json',
method='POST', method='POST',
payload_type='status', payload_type='status',
allowed_param=['status', 'in_reply_to_status_id', 'in_reply_to_status_id_str','lat', 'long', 'source', 'place_id', 'display_coordinates'], allowed_param=['status', 'in_reply_to_status_id', 'in_reply_to_status_id_str', 'auto_populate_reply_metadata', 'lat', 'long', 'source', 'place_id', 'display_coordinates'],
require_auth=True require_auth=True
)(post_data=post_data, *args, **kwargs) )(post_data=post_data, *args, **kwargs)
...@@ -213,7 +213,7 @@ class API(object): ...@@ -213,7 +213,7 @@ class API(object):
def update_with_media(self, filename, *args, **kwargs): def update_with_media(self, filename, *args, **kwargs):
""" :reference: https://dev.twitter.com/rest/reference/post/statuses/update_with_media """ :reference: https://dev.twitter.com/rest/reference/post/statuses/update_with_media
:allowed_param:'status', 'possibly_sensitive', 'in_reply_to_status_id', 'in_reply_to_status_id_str', 'lat', 'long', 'place_id', 'display_coordinates' :allowed_param:'status', 'possibly_sensitive', 'in_reply_to_status_id', 'in_reply_to_status_id_str', 'auto_populate_reply_metadata', 'lat', 'long', 'place_id', 'display_coordinates'
""" """
f = kwargs.pop('file', None) f = kwargs.pop('file', None)
headers, post_data = API._pack_image(filename, 3072, form_field='media[]', f=f) headers, post_data = API._pack_image(filename, 3072, form_field='media[]', f=f)
...@@ -226,7 +226,7 @@ class API(object): ...@@ -226,7 +226,7 @@ class API(object):
payload_type='status', payload_type='status',
allowed_param=[ allowed_param=[
'status', 'possibly_sensitive', 'in_reply_to_status_id', 'in_reply_to_status_id_str', 'status', 'possibly_sensitive', 'in_reply_to_status_id', 'in_reply_to_status_id_str',
'lat', 'long', 'place_id', 'display_coordinates' 'auto_populate_reply_metadata', 'lat', 'long', 'place_id', 'display_coordinates'
], ],
require_auth=True require_auth=True
)(*args, **kwargs) )(*args, **kwargs)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment