aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Diener <[email protected]>2020-02-22 19:50:24 +0100
committerLorenz Diener <[email protected]>2020-02-22 19:50:24 +0100
commit65e49ec61414dc36afa6df84d581d77a1ac40afb (patch)
treec6c5e142c56060e04bddf3f8c6dc9026edc02c5a
parent05e2bcb967946211320d47140ab42a9600b8aff2 (diff)
downloadmastodon.py-65e49ec61414dc36afa6df84d581d77a1ac40afb.tar.gz
Add bookmarks
-rw-r--r--mastodon/Mastodon.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py
index d919be9..a986ec3 100644
--- a/mastodon/Mastodon.py
+++ b/mastodon/Mastodon.py
@@ -1613,6 +1613,18 @@ class Mastodon:
1613 return self.__api_request('GET', '/api/v1/markers', params) 1613 return self.__api_request('GET', '/api/v1/markers', params)
1614 1614
1615 ### 1615 ###
1616 # Reading data: Bookmarks
1617 ###
1618 @api_version("3.1.0", "3.1.0", __DICT_VERSION_STATUS)
1619 def bookmarks(self):
1620 """
1621 Get a list of statuses bookmarked by the logged-in user.
1622
1623 Returns a list of `toot dicts`_.
1624 """
1625 return self.__api_request('GET', '/api/v1/bookmarks')
1626
1627 ###
1616 # Writing data: Statuses 1628 # Writing data: Statuses
1617 ### 1629 ###
1618 @api_version("1.0.0", "2.8.0", __DICT_VERSION_STATUS) 1630 @api_version("1.0.0", "2.8.0", __DICT_VERSION_STATUS)
@@ -1927,6 +1939,29 @@ class Mastodon:
1927 id = self.__unpack_id(id) 1939 id = self.__unpack_id(id)
1928 url = '/api/v1/statuses/{0}/unpin'.format(str(id)) 1940 url = '/api/v1/statuses/{0}/unpin'.format(str(id))
1929 return self.__api_request('POST', url) 1941 return self.__api_request('POST', url)
1942
1943
1944 @api_version("3.1.0", "3.1.0", __DICT_VERSION_STATUS)
1945 def status_bookmark(self, id):
1946 """
1947 Bookmark a status as the logged-in user.
1948
1949 Returns a `toot dict`_ with the now bookmarked status
1950 """
1951 id = self.__unpack_id(id)
1952 url = '/api/v1/statuses/{0}/bookmark'.format(str(id))
1953 return self.__api_request('POST', url)
1954
1955 @api_version("3.1.0", "3.1.0", __DICT_VERSION_STATUS)
1956 def status_unbookmark(self, id):
1957 """
1958 Unbookmark a bookmarked status for the logged-in user.
1959
1960 Returns a `toot dict`_ with the status that used to be bookmarked.
1961 """
1962 id = self.__unpack_id(id)
1963 url = '/api/v1/statuses/{0}/unbookmark'.format(str(id))
1964 return self.__api_request('POST', url)
1930 1965
1931 ### 1966 ###
1932 # Writing data: Scheduled statuses 1967 # Writing data: Scheduled statuses
Powered by cgit v1.2.3 (git 2.41.0)