Get Twitter Name

I'm new to OAuth

I want to know how to use the "Twitter OAuth library from Abraham Wiliam" to get user credentials such as screen_name.

+3
source share
2 answers

Download this library https://github.com/abraham/twitteroauth You only need the twitteroauth.php and OAuth.php files. Include only twitteroauth.php .

Here's a sample Twitter: https://dev.twitter.com/docs/auth/oauth/single-user-with-examples#php

After declaring the function getConnectionWithAccessToken()and variable $connectionwith valid application tokens , just try the code

$user = $connection->get("account/verify_credentials");
print $user->screen_name;

API REST Twitter

+6

Source: https://habr.com/ru/post/1750629/


All Articles