You can do this using the YouTube API . What you need to do is add an extra area to your login button. I would recommend using the following area:
https:
Do this because you will not manage any YouTube account simply by viewing their personal data (for example, to pull out links or paste the code for your YouTube videos).
Then you need to make the API call on YouTube using the client library. For experimentation you can use the explorer API . To view your information, authorize the request, set the part to βfragmentβ (without quotes), and then set me to true.
Download the "youtube", "v3" static class from the Google API client library , then make the call transfer snippet as part of what you want, and "mine" is set to true.
To list the current user videos, there is an example that comes with the PHP client library . The following change lists user actions:
// Exchange the OAuth 2.0 authorization code for user credentials. $client->authenticate($code); $token = json_decode($client->getAccessToken()); ... $activities = $youtube->activities->listActivities('snippet', array( 'mine' => 'true', )); foreach ($activities['items'] as $activity) { error_log(serialize($activity)); }
class source share