Hi. I’m extremely new to web dev, so apologies if this has been discussed before. I’ve read nearly everything Barry Carlyon has posted on this site and still can’t figure out a solution.
Basically, I’m trying to create a user for my webpage after they’ve authorized with oauth. I already have the oauth part figured out, and I’m successfully accessing an access token and saving it to variable access_token. I then initialize a client.
client = Twitch::Client.new(:access_token => access_token)
When I code
puts client
#Twitch::User:0x00007fa84f29#### is returned. So my questions are:
-
How can I use this object to access various user info, such as email, display_name, and profile_image_url? (I included get:user:email as the scope in the initial GET.)
-
How can I store an instance of this user in my DB?
This is what I’ve tried so far:
user = client.get_users.data
profile_data = { :profile_image_url => user.profile_image_url, :display_name => user.display_name, :email => user.email, :id => user.id }
Thanks a ton in advance.