Don't send since_id if there's no newest post
This commit is contained in:
parent
e3cca4f40c
commit
06d35d0515
|
@ -49,12 +49,12 @@ class TweetFetcher
|
||||||
|
|
||||||
public function getTweets(): Collection
|
public function getTweets(): Collection
|
||||||
{
|
{
|
||||||
$newestTweet = $this->tweetRepository->findNewestTweet();
|
$params = ['q' => collect($this->params()->all())->implode(' AND ')];
|
||||||
|
if ($newestTweet = $this->tweetRepository->findNewestTweet()) {
|
||||||
|
$params['since_id'] = $newestTweet->getId();
|
||||||
|
}
|
||||||
|
|
||||||
$response = collect($this->codebird->get()->search_tweets([
|
$response = collect($this->codebird->get()->search_tweets($params));
|
||||||
'q' => collect($this->params()->all())->implode(' AND '),
|
|
||||||
// 'since_id' => $newestTweet ? $newestTweet->getId() : null,
|
|
||||||
]));
|
|
||||||
|
|
||||||
if ($response->get('httpstatus') != 200) {
|
if ($response->get('httpstatus') != 200) {
|
||||||
dump($response);
|
dump($response);
|
||||||
|
|
Loading…
Reference in a new issue