【Silex】TwitterOAuthの使い方
<?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