Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Add CalcKey Instance Support #60

Closed
MrHamel opened this issue Jul 2, 2023 · 4 comments · Fixed by #66
Closed

Enhancement: Add CalcKey Instance Support #60

MrHamel opened this issue Jul 2, 2023 · 4 comments · Fixed by #66
Labels
enhancement New feature or request

Comments

@MrHamel
Copy link

MrHamel commented Jul 2, 2023

CalcKey's API documentation can be found at https://calckey.social/api-doc

For both pulling in posts, but also updating timelines, etc.

@Teqed
Copy link
Contributor

Teqed commented Jul 2, 2023

Additional information:

Calckey is downstream of Misskey, differences are noted.

  • .well-known/nodeinfo response: Yes
  • Nodeinfo path: {server}/nodeinfo/2.0 and {server}/nodeinfo/2.1
  • Nodeinfo response: misskey or calckey
  • Users URL pattern: {server}/@{user}
  • "Posts" URL pattern: {server}/notes/{id}

Calckey's API documentation mentions notes/children and notes/conversation endpoints which can be POSTed to using a noteID as parsed from the URL. This appears to function similar to Mastodon's Context API and respectively fetch ancestors and descendants of a "note".

A CLI example: curl -X POST -H "Content-type: application/json" -H "Accept: application/json" -d '{ "noteId": "{id}" }' {server}/api/notes/children will return a JSON with the replies, including a URL that can be handed back to the local Mastodon server's search API for lookup.

For user profile backfilling, there is a user/notes endpoint but it requires a userID which does not parse from the user's name in the URL. It should be possible to make a request against the users/search endpoint and provide the parsed username as the query parameter, which will return the required userID.

Because the user URLs match the same pattern as Mastodon profiles, the choices here would be to either:

  1. After failing against any Mastodon API, attempt Misskey/Calckey API.
  2. Implement nodeinfo as discussed here to determine the appropriate API.

@nanos
Copy link
Owner

nanos commented Jul 3, 2023

Thanks for the suggestion @MrHamel and thanks for the detailed report @Teqed !

For user profile backfilling, there is a user/notes endpoint but it requires a userID which does not parse from the user's name in the URL. It should be possible to make a request against the users/search endpoint and provide the parsed username as the query parameter, which will return the required userID.

That's the same with Mastodon, see

def get_user_id(server, user = None, access_token = None):
annoyingly a different path, though.

Because the user URLs match the same pattern as Mastodon profiles, the choices here would be to either:

  1. After failing against any Mastodon API, attempt Misskey/Calckey API.
  2. Implement nodeinfo as discussed here to determine the appropriate API.

I'm personally strongly in favour of the 2nd option here. Doing 2 requests per user seems wasteful.

I'm not currently having capacity to actually implement this, but hopefully later in the summer. If you have an itch, and the time, I'd be very happy, too, though 😉

@MrHamel
Copy link
Author

MrHamel commented Aug 5, 2023

Let's reopen this issue since the script still does not import posts into CalcKey/FireFish instances, thanks.

@nanos
Copy link
Owner

nanos commented Aug 5, 2023

Apologies @MrHamel. Like @ToadKing i understood this issue to mean to offer support for pulling in content from Calckey/Firefish instances, not to actually support running FediFetcher against them.

I need to be honest though: I do not have a Firefish instance, so I’m unable to implement Firefish support myself. Unless someone else came along and implemented this, and was willing to commit to ongoing testing and support Firefish, this is unfortunately very unlikely to be implemented in FediFetcher.

@nanos nanos added the help wanted Extra attention is needed label Aug 5, 2023
@nanos nanos reopened this Aug 5, 2023
@nanos nanos removed the help wanted Extra attention is needed label Aug 5, 2023
@nanos nanos closed this as completed Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants