Conversation

Necromancer akkohi2 mylittlevoid

@fedilab Hi, how do you detect which API to use for a service? Is there a hardcoded list of software names you compare to the nodeinfo or do you look for specific endpoints (like /api/v1/instance)?
1
0
0
@fedilab so there is there a special case for Pleroma because they won't return a 404 on the nodeinfo endpoint?
1
0
0
@fedilab OK, I've been wondering because I wasn't able to log into an account on a server running a small implementation which supports the Masto API
1
0
0
@fedilab It's an AP implementation I've been writing for about a month now.
I think it doesn't work because of the name check in line 230 in API.java since the name won't match anything in the switch statement
1
0
0
@fedilab I'm sorry but I don't have access to a computer right now, so I can't start the server. But I think that Pleroma has a special flag in the version field of "/api/v1/instance". It should be something like "2.4.0 (compatible; Pleroma-[commit])".
I've adapted this schema as well because some crawlers use it do differentiate between Pleroma and Mastodon
1
0
0
@fedilab
the function works like intended (sorry if my posts were confusing to read).
i've got an idea for the nodeinfo check which should cover other new implementations which support the mastodon api.

pleroma and other projects which implement the mastodon api and nodeinfo (kibou, my ap server, etc.) have "mastodon_api" listed in the "features" array. would it be possible to check for this list entry?
1
0
1

@fedilab Would this work if it was placed in front of the check in line 229 (with java.util.Arrays imported ofc)?

if( resobj.getJSONArray("features") != null ) {
    if( Arrays.asList(resobj.getJSONArray("features")).contains("mastodon_api") ) {
        name = "MASTODON";
    }
}

I can’t test it for myself because I know nothing about Android app development but I can send you a login to the server in a DM. I wanted to reset the database today anyways

1
0
0