Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Last active January 15, 2016 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurozumi/1d5dc05d2902e9e0f5d3 to your computer and use it in GitHub Desktop.
Save kurozumi/1d5dc05d2902e9e0f5d3 to your computer and use it in GitHub Desktop.
【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