+1
-10
app/mastodon_api.rb
+1
-10
app/mastodon_api.rb
···
31
end
32
33
def oauth_login_with_password(client_id, client_secret, email, password, scopes)
34
-
url = URI("https://#{@host}/oauth/token")
35
-
36
params = {
37
client_id: client_id,
38
client_secret: client_secret,
···
42
password: password
43
}
44
45
-
response = Net::HTTP.post_form(url, params)
46
-
status = response.code.to_i
47
-
48
-
if status / 100 == 2
49
-
JSON.parse(response.body)
50
-
else
51
-
raise APIError.new(response)
52
-
end
53
end
54
55
def account_info