Overview

Namespaces

  • AlexisLefebvre
    • Bundle
      • AsyncTweetsBundle
        • Command
        • Controller
        • Entity
        • Utils

Classes

  • AlexisLefebvre\Bundle\AsyncTweetsBundle\AsyncTweetsBundle
  • AlexisLefebvre\Bundle\AsyncTweetsBundle\Command\BaseCommand
  • AlexisLefebvre\Bundle\AsyncTweetsBundle\Command\StatusesHomeTimelineCommand
  • AlexisLefebvre\Bundle\AsyncTweetsBundle\Command\StatusesHomeTimelineTestCommand
  • AlexisLefebvre\Bundle\AsyncTweetsBundle\Command\StatusesReadCommand
  • AlexisLefebvre\Bundle\AsyncTweetsBundle\Command\StatusesShowCommand
  • AlexisLefebvre\Bundle\AsyncTweetsBundle\Controller\DefaultController
  • AlexisLefebvre\Bundle\AsyncTweetsBundle\Entity\Media
  • AlexisLefebvre\Bundle\AsyncTweetsBundle\Entity\Tweet
  • AlexisLefebvre\Bundle\AsyncTweetsBundle\Entity\TweetRepository
  • AlexisLefebvre\Bundle\AsyncTweetsBundle\Entity\User
  • AlexisLefebvre\Bundle\AsyncTweetsBundle\Utils\PersistTweet
  • Overview
  • Namespace
  • Class
  • Tree
 1: <?php
 2: 
 3: namespace AlexisLefebvre\Bundle\AsyncTweetsBundle\Command;
 4: 
 5: use Abraham\TwitterOAuth\TwitterOAuth;
 6: use Symfony\Component\Console\Input\InputArgument;
 7: use Symfony\Component\Console\Input\InputInterface;
 8: use Symfony\Component\Console\Output\OutputInterface;
 9: 
10: class StatusesShowCommand extends BaseCommand
11: {
12:     protected function configure()
13:     {
14:         parent::configure();
15: 
16:         $this
17:             ->setName('statuses:show')
18:             ->setDescription('Show one tweet (for debugging)')
19:             ->addArgument('tweet_id', InputArgument::REQUIRED, 'Tweet ID');
20:     }
21: 
22:     /**
23:      * @param InputInterface  $input
24:      * @param OutputInterface $output
25:      */
26:     protected function execute(InputInterface $input, OutputInterface $output)
27:     {
28:         $tweet_id = $input->getArgument('tweet_id');
29: 
30:         $connection = new TwitterOAuth(
31:             $this->container->getParameter('twitter_consumer_key'),
32:             $this->container->getParameter('twitter_consumer_secret'),
33:             $this->container->getParameter('twitter_token'),
34:             $this->container->getParameter('twitter_token_secret')
35:         );
36: 
37:         $output->writeln(
38:             json_encode($connection->get('statuses/show/'.$tweet_id))
39:         );
40:     }
41: }
42: 
AsyncTweetsBundle API documentation generated by ApiGen