Add method for retweeting
This commit is contained in:
parent
802a9b0ba2
commit
e8ad0b9b91
|
@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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'],
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue