Added 'remote' param to GET /api/v1/timelines/public (Mastodon v3.1.4)
This commit is contained in:
pare
f49203f9a4
commit
e33166f025
S'han modificat 3 arxius amb 33 adicions i 48 eliminacions
48
README.rst
48
README.rst
|
@ -1,21 +1,18 @@
|
|||
Mastodon.py
|
||||
Mastodonplus.py
|
||||
===========
|
||||
Python wrapper for the Mastodon ( https://github.com/tootsuite/mastodon/ ) API.
|
||||
Feature complete for public API as of Mastodon version 3.0.1 and easy to get started with:
|
||||
Fork of Python wrapper for the Mastodon ( https://github.com/tootsuite/mastodon/ ) API.
|
||||
|
||||
.. code-block:: python
|
||||
This fork's goal is to add new Mastodon API's endpoints to the excellent halcy's wrapper.
|
||||
|
||||
# Register your app! This only needs to be done once. Uncomment the code and substitute in your information.
|
||||
|
||||
from mastodon import Mastodon
|
||||
|
||||
'''
|
||||
Mastodon.create_app(
|
||||
'pytooterapp',
|
||||
api_base_url = 'https://mastodon.social',
|
||||
api_base_url = 'https://your-mastodon.server',
|
||||
to_file = 'pytooter_clientcred.secret'
|
||||
)
|
||||
'''
|
||||
|
||||
# Then login. This can be done every time, or use persisted.
|
||||
|
||||
|
@ -23,7 +20,7 @@ Feature complete for public API as of Mastodon version 3.0.1 and easy to get sta
|
|||
|
||||
mastodon = Mastodon(
|
||||
client_id = 'pytooter_clientcred.secret',
|
||||
api_base_url = 'https://mastodon.social'
|
||||
api_base_url = 'https://your-mastodon.server'
|
||||
)
|
||||
mastodon.log_in(
|
||||
'my_login_email@example.com',
|
||||
|
@ -37,40 +34,17 @@ Feature complete for public API as of Mastodon version 3.0.1 and easy to get sta
|
|||
|
||||
mastodon = Mastodon(
|
||||
access_token = 'pytooter_usercred.secret',
|
||||
api_base_url = 'https://mastodon.social'
|
||||
api_base_url = 'https://your-mastodon.server'
|
||||
)
|
||||
mastodon.toot('Tooting from python using #mastodonpy !')
|
||||
|
||||
You can install Mastodon.py via pypi:
|
||||
|
||||
.. code-block:: Bash
|
||||
You can install Mastodonplus.py via pypi:
|
||||
|
||||
# Python 3
|
||||
pip3 install Mastodon.py
|
||||
pip3 install Mastodonplus.py
|
||||
|
||||
Note that python 2.7 is now no longer officially supported. It will still
|
||||
work for a while, and we will fix issues as they come up, but we will not
|
||||
be testing specifically for python 2.7 any longer.
|
||||
# New features
|
||||
|
||||
Full documentation and basic usage examples can be found
|
||||
at http://mastodonpy.readthedocs.io/en/stable/ .
|
||||
|
||||
Maintenance
|
||||
-----------
|
||||
As you might have noticed, I have not done any maint work on this project in a while.
|
||||
I am currently extremely busy with my actual paid work, and will not be able to work
|
||||
on Mastodon.py until I hand in my dissertation, i.e. there will be no new releases or
|
||||
code from me for at least the rest of this year, maybe part of next. If you would like
|
||||
to temporarily take over bug fixing / test writing / new method implementing, hit me up.
|
||||
|
||||
Acknowledgements
|
||||
----------------
|
||||
Mastodon.py contains work by a large amount of contributors, many of which have
|
||||
put significant work into making it a better library. You can find some information
|
||||
about who helped with which particular feature or fix in the changelog.
|
||||
|
||||
.. image:: https://travis-ci.org/halcy/Mastodon.py.svg?branch=master
|
||||
:target: https://travis-ci.org/halcy/Mastodon.py
|
||||
.. image:: https://codecov.io/gh/halcy/Mastodon.py/branch/master/graph/badge.svg
|
||||
:target: https://codecov.io/gh/halcy/Mastodon.py
|
||||
* 26.8.2022. Added New endpoints: /api/v1/admin/domain_blocks (list, show by id, delete and create)
|
||||
* 27.8.2022. Mastodon v3.1.4. Added 'remote" param to GET /api/v1/timelines/public REST API.
|
||||
|
||||
|
|
|
@ -788,7 +788,7 @@ class Mastodon:
|
|||
since_id=since_id, limit=limit)
|
||||
|
||||
@api_version("1.0.0", "2.6.0", __DICT_VERSION_STATUS)
|
||||
def timeline_public(self, max_id=None, min_id=None, since_id=None, limit=None, only_media=False):
|
||||
def timeline_public(self, max_id=None, min_id=None, since_id=None, limit=None, only_media=False, remote=None):
|
||||
"""
|
||||
Fetches the public / visible-network timeline, not including replies.
|
||||
|
||||
|
@ -810,6 +810,9 @@ class Mastodon:
|
|||
if only_media == False:
|
||||
del params_initial['only_media']
|
||||
|
||||
if remote != None:
|
||||
params_initial['remote'] = remote
|
||||
|
||||
url = '/api/v1/timelines/public'
|
||||
params = self.__generate_params(params_initial)
|
||||
|
||||
|
|
18
setup.py
18
setup.py
|
@ -1,4 +1,6 @@
|
|||
from setuptools import setup
|
||||
import setuptools
|
||||
|
||||
VERSION = '1.5.5.1'
|
||||
|
||||
test_deps = [
|
||||
'pytest',
|
||||
|
@ -25,10 +27,16 @@ extras = {
|
|||
"blurhash": blurhash_deps,
|
||||
}
|
||||
|
||||
setup(name='Mastodon.py',
|
||||
version='1.5.1',
|
||||
description='Python wrapper for the Mastodon API',
|
||||
with open('README.rst', 'r', encoding='utf-8') as fh:
|
||||
long_description = fh.read()
|
||||
|
||||
setuptools.setup(
|
||||
name='Mastodonplus.py',
|
||||
version=VERSION,
|
||||
description='Python wrapper for the Mastodon API (new endpoints)',
|
||||
packages=['mastodon'],
|
||||
long_description=long_description,
|
||||
long_description_content_type='text/markdown',
|
||||
install_requires=[
|
||||
'requests>=2.4.2',
|
||||
'python-dateutil',
|
||||
|
@ -39,7 +47,7 @@ setup(name='Mastodon.py',
|
|||
] + blurhash_deps,
|
||||
tests_require=test_deps,
|
||||
extras_require=extras,
|
||||
url='https://github.com/halcy/Mastodon.py',
|
||||
url='https://git.mastodont.cat/spla/Mastodon.py',
|
||||
author='Lorenz Diener',
|
||||
author_email='lorenzd+mastodonpypypi@gmail.com',
|
||||
license='MIT',
|
||||
|
|
Loading…
Referencia en una nova incidència