Skip to content

Instantly share code, notes, and snippets.

View m13z's full-sized avatar

Marcos Fernández m13z

  • Palma, Illes Balears, Spain
View GitHub Profile
@m13z
m13z / twitter_oauth_curl.php
Last active November 22, 2018 02:41
Super simple PHP twitter oauth request without user context (https://dev.twitter.com/docs/auth/application-only-auth)
/*
* using curl
*/
$key = 'YOUR_KEY_HERE';
$secret = 'YOUR_SECRET_HERE';
$api_endpoint = 'https://api.twitter.com/1.1/users/show.json?screen_name=marcosfernandez'; // endpoint must support "Application-only authentication"
// request token
$basic_credentials = base64_encode($key.':'.$secret);