Added local timeline support
This commit is contained in:
pare
f734a45fb6
commit
9eaf955bfc
S'han modificat 2 arxius amb 18 adicions i 3 eliminacions
|
@ -206,6 +206,7 @@ user could see, as well as hashtag timelines and the public timeline.
|
||||||
.. automethod:: Mastodon.timeline
|
.. automethod:: Mastodon.timeline
|
||||||
.. automethod:: Mastodon.timeline_home
|
.. automethod:: Mastodon.timeline_home
|
||||||
.. automethod:: Mastodon.timeline_mentions
|
.. automethod:: Mastodon.timeline_mentions
|
||||||
|
.. automethod:: Mastodon.timeline_local
|
||||||
.. automethod:: Mastodon.timeline_public
|
.. automethod:: Mastodon.timeline_public
|
||||||
.. automethod:: Mastodon.timeline_hashtag
|
.. automethod:: Mastodon.timeline_hashtag
|
||||||
|
|
||||||
|
|
|
@ -162,14 +162,20 @@ class Mastodon:
|
||||||
##
|
##
|
||||||
def timeline(self, timeline = "home", max_id = None, since_id = None, limit = None):
|
def timeline(self, timeline = "home", max_id = None, since_id = None, limit = None):
|
||||||
"""
|
"""
|
||||||
Fetch statuses, most recent ones first. Timeline can be home, mentions, public
|
Fetch statuses, most recent ones first. Timeline can be home, mentions, local,
|
||||||
or tag/hashtag. See the following functions documentation for what those do.
|
public, or tag/hashtag. See the following functions documentation for what those do.
|
||||||
|
|
||||||
The default timeline is the "home" timeline.
|
The default timeline is the "home" timeline.
|
||||||
|
|
||||||
Returns a list of toot dicts.
|
Returns a list of toot dicts.
|
||||||
"""
|
"""
|
||||||
params = self.__generate_params(locals(), ['timeline'])
|
params_initial = locals()
|
||||||
|
|
||||||
|
if timeline == "local":
|
||||||
|
timeline = "public"
|
||||||
|
params_initial['local'] = True
|
||||||
|
|
||||||
|
params = self.__generate_params(params_initial, ['timeline'])
|
||||||
return self.__api_request('GET', '/api/v1/timelines/' + timeline, params)
|
return self.__api_request('GET', '/api/v1/timelines/' + timeline, params)
|
||||||
|
|
||||||
def timeline_home(self, max_id = None, since_id = None, limit = None):
|
def timeline_home(self, max_id = None, since_id = None, limit = None):
|
||||||
|
@ -188,6 +194,14 @@ class Mastodon:
|
||||||
"""
|
"""
|
||||||
return self.timeline('mentions', max_id = max_id, since_id = since_id, limit = limit)
|
return self.timeline('mentions', max_id = max_id, since_id = since_id, limit = limit)
|
||||||
|
|
||||||
|
def timeline_local(self, max_id = None, since_id = None, limit = None):
|
||||||
|
"""
|
||||||
|
Fetches the local / instance-wide timeline.
|
||||||
|
|
||||||
|
Returns a list of toot dicts.
|
||||||
|
"""
|
||||||
|
return self.timeline('local', max_id = max_id, since_id = since_id, limit = limit)
|
||||||
|
|
||||||
def timeline_public(self, max_id = None, since_id = None, limit = None):
|
def timeline_public(self, max_id = None, since_id = None, limit = None):
|
||||||
"""
|
"""
|
||||||
Fetches the public / visible-network timeline.
|
Fetches the public / visible-network timeline.
|
||||||
|
|
Loading…
Referencia en una nova incidència