Last active
January 15, 2016 10:20
-
-
Save kurozumi/1d5dc05d2902e9e0f5d3 to your computer and use it in GitHub Desktop.
【Silex】TwitterOAuthの使い方
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once __DIR__.'/vendor/autoload.php'; | |
use Silex\Application; | |
$app = new Application(); | |
$app->register(new Acme\ServiceProvider\TwitterOAuthServiceProvider(), [ | |
'twitter.consumer_key' => TWITTER_CONSUMER_KRY, | |
'twitter.consumer_secret' => TWITTER_CONSUMER_SERCRET, | |
'twitter.access_token' => TWITTER_ACCESS_TOKEN, | |
'twitter.access_token_secret' => TWITTER_ACCESS_TOKEN_SECRET | |
]); | |
$app->get('/t', function (Application $app) { | |
return $app['twitter.connection']->get("account/verify_credentials"); | |
}); | |
$app->run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment