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)
13 lines
260 B
Ruby
13 lines
260 B
Ruby
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
|