|
|
@ -55,6 +55,10 @@ class BeagleService
|
|
|
|
return [];
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ((bool) config('instance.discover.beagle_api') == false) {
|
|
|
|
|
|
|
|
return [];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return Cache::remember(self::DISCOVER_CACHE_KEY, now()->addHours(6), function () {
|
|
|
|
return Cache::remember(self::DISCOVER_CACHE_KEY, now()->addHours(6), function () {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
$res = Http::withOptions(['allow_redirects' => false])
|
|
|
|
$res = Http::withOptions(['allow_redirects' => false])
|
|
|
@ -92,6 +96,10 @@ class BeagleService
|
|
|
|
return [];
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ((bool) config('instance.discover.beagle_api') == false) {
|
|
|
|
|
|
|
|
return [];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return Cache::remember(self::DISCOVER_POSTS_CACHE_KEY, now()->addHours(1), function () {
|
|
|
|
return Cache::remember(self::DISCOVER_POSTS_CACHE_KEY, now()->addHours(1), function () {
|
|
|
|
$posts = collect(self::getDiscover())
|
|
|
|
$posts = collect(self::getDiscover())
|
|
|
|
->filter(function ($post) {
|
|
|
|
->filter(function ($post) {
|
|
|
|