diff --git a/src/Command/RetweetTweetsCommand.php b/src/Command/RetweetTweetsCommand.php index c717d7d..8e08088 100644 --- a/src/Command/RetweetTweetsCommand.php +++ b/src/Command/RetweetTweetsCommand.php @@ -37,7 +37,7 @@ class RetweetTweetsCommand extends Command protected function execute(InputInterface $input, OutputInterface $output) { $this->tweetFetcher->getTweets()->each(function (array $tweet) { - $this->retweeter->retweet(); + $this->retweeter->retweet($tweet); }); } } diff --git a/src/Service/Retweeter.php b/src/Service/Retweeter.php index b89c7f8..d32594b 100644 --- a/src/Service/Retweeter.php +++ b/src/Service/Retweeter.php @@ -25,4 +25,11 @@ class Retweeter $this->codebird = $codebird; } + + public function retweet(array $tweet): void + { + $this->codebird->statuses_retweet_ID([ + 'id' => $tweet['id'], + ]); + } }