Comments (5)
Hi! v2 instance API is WIP currently, and the next release will have it, though I am currently busy with other projects, so it'll be a bit before I can get back to that. Think something like mid to end August, hopefully. I've also considered adding a character counting helper that would help with that, but that's after that, even.
That said: The v1 API that mastodon.py fetches current should include that. See, for example:
https://icosahedron.website/api/v1/instance
Under configuration.statuses, there is the information you'd want. Though also, only for recent versions, not sure at which it starts. Some software and patches will have exposed it as part of nodeinfo instead. It is a bit of a mess, which I would like to try to abstract away for this specific use case, which is why see above.
What instance are you trying to get that information from?
from mastodon.py.
I wasn't aware of the v1 and v2 distinction of the API.
What instance are you trying to get that information from?
I am interested in getting max_characters
from any instance (this is for integration in a bot that can run anywhere).
The v1 API that mastodon.py fetches current should include that
Are you saying that that a call to Mastodon.instance()
returns the contents of the JSON object returned by api/v1/instance
?. The documentation for the Instance Dict looks more limited and does not include max_characters
.
If not, I can fetch the data from api/v1/instance
directly but it would be nice to have it through Mastodon.py.
Thanks.
from mastodon.py.
It does return that! The documentation is out of date somewhat - earlier versions of Mastodon did not include the "configuration" part, and I haven't updated docs to reflect that it now does. I am trying to fix all of that, but I've been bogged down somewhat. The next version will have much better and more up to date (and also more easily updateable) documentation.
You should be able to just call mastodon.instance().configuration.statuses to get the status info - if the instance is new enough. If you do that, probably wrap it in a try -> except statement and assume that if it fails, value is masto default of 500.
from mastodon.py.
Sound good! I should have tried calling mastodon.instance()
and look at the result.
Anyway, keep up with the effort that you put behind Mastodon.py, it is well worth it. Thanks!
from mastodon.py.
closing resolved
from mastodon.py.
Related Issues (20)
- Streaming not working HOT 5
- Add `offset` parameter for `trending_statuses`
- MastodonVersionError: Version check failed (Need version 1.1.0) HOT 5
- Add Citation for Mastodon.py HOT 3
- Update filter methods to 4.x HOT 2
- Unable to Host bot HOT 8
- [question] Keeping async listener connection active? HOT 2
- media_update return Error 404: Record not found HOT 1
- Event on mentioned? HOT 2
- mastodon.account_search not working correctly? HOT 10
- Deprecate visibility parameter value `private` and use `followers_only` instead HOT 3
- module is installed, but missing library stubs or py.typed marker HOT 5
- scopes = ['read', 'write'] is ret, but the generated url sill contains '+follow+push' HOT 6
- OAuth question HOT 2
- TypeError: exceptions must derive from BaseException HOT 3
- [Question] Is there a way to export lists as CSV? HOT 2
- [Question] scheduling posts and replies HOT 2
- content_type is not ignored on incompatible servers HOT 2
- [question] retrieving most recent status for a user HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mastodon.py.