Sync Mastodon IDs/profiles to local accounts

Add a new service to import some data from Mastodon accounts:

* Find users by username, store Mastodon account ID in local db when
  found
* Import display name (don't overwrite existing)
* Import avatar (don't overwrite existing)
This commit is contained in:
2025-05-17 16:44:28 +04:00
parent c291765777
commit 37c59b7b0c
9 changed files with 197 additions and 60 deletions

View File

@@ -0,0 +1,12 @@
module MastodonManager
class FetchUser < MastodonManagerService
def initialize(mastodon_id:)
@mastodon_id = mastodon_id
end
def call
user = get "v1/admin/accounts/#{@mastodon_id}"
user.with_indifferent_access
end
end
end