Z
Z
zasqer2014-10-20 22:26:14
Twitter
zasqer, 2014-10-20 22:26:14

How to get the name and photo of a user on twitter?

Broke my brain about the twitter documentation. Tell me how to get the name and photo of a user on Twitter?
Already killed more time on Twitter than on Facebook, Google and VKontakte combined.
I can't even authenticate.
Here's how I do it on other social networks:

// VKONTAKTE
        function vk_auth_account() {
            var vk_client_id = '**********'

            var vk_oauth_url = "https://oauth.vk.com/authorize?" +
                                    "client_id=" + vk_client_id + "&" +
                                    "scope=email&" +
                                    "redirect_uri=" + document.location.origin + "/auth/vk_auth" + "&" +
                                    "response_type=code&" +
                                    "v=5.25"

            window.location = vk_oauth_url
        }

        // FACEBOOK
        function fb_auth_account() {
            var fb_client_id = '**********'

            var fb_oauth_url = "http://www.facebook.com/dialog/oauth/?" +
                                    "scope=email&"+
                                    "client_id=" + fb_client_id + "&" +
                                    "redirect_uri=" + document.location.origin + "/feedback" + "&" +
                                    "response_type=token"

            window.location = fb_oauth_url
        } 

        // GOOGLE
        function google_auth_account() {
            var google_client_id = '**********'

            var google_oauth_url = 'https://accounts.google.com/o/oauth2/auth?' +
                                    'scope=email&' +
                                    'redirect_uri=' + document.location.origin + '/feedback&' +
                                    'response_type=token&' +
                                    'client_id=' + google_client_id + '&' +
                                    'approval_prompt=force'

            window.location = google_oauth_url
        }

Poke in the link or tell me the code, how can I do the same on Twitter?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kazmirchuk, 2014-10-20
@WebDizi

You need to use the REST API see https://dev.twitter.com/rest/reference/get/users/show

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question