Add method for retweeting

This commit is contained in:
Oliver Davies 2019-01-10 23:15:45 +00:00
parent 802a9b0ba2
commit e8ad0b9b91
2 changed files with 8 additions and 1 deletions

View file

@ -37,7 +37,7 @@ class RetweetTweetsCommand extends Command
protected function execute(InputInterface $input, OutputInterface $output) protected function execute(InputInterface $input, OutputInterface $output)
{ {
$this->tweetFetcher->getTweets()->each(function (array $tweet) { $this->tweetFetcher->getTweets()->each(function (array $tweet) {
$this->retweeter->retweet(); $this->retweeter->retweet($tweet);
}); });
} }
} }

View file

@ -25,4 +25,11 @@ class Retweeter
$this->codebird = $codebird; $this->codebird = $codebird;
} }
public function retweet(array $tweet): void
{
$this->codebird->statuses_retweet_ID([
'id' => $tweet['id'],
]);
}
} }