sync
This commit is contained in:
@@ -5,12 +5,9 @@
|
||||
use App\Helpers\FirstParty\OSSUploader\OSSUploader;
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Intervention\Image\Facades\Image;
|
||||
use Minifier\TinyMinify;
|
||||
use Spatie\Browsershot\Browsershot;
|
||||
use Spatie\Browsershot\Exceptions\UnsuccessfulResponse;
|
||||
use Symfony\Component\DomCrawler\Crawler;
|
||||
use thiagoalessio\TesseractOCR\TesseractOCR;
|
||||
|
||||
class UrlCrawlerTask
|
||||
{
|
||||
@@ -60,8 +57,7 @@ public static function handle(string $url, $directory, $postfix = null, $strip_h
|
||||
])
|
||||
->get($cached_url);
|
||||
|
||||
if ($response->successful())
|
||||
{
|
||||
if ($response->successful()) {
|
||||
$raw_html = $response->body();
|
||||
$costs['unblocker'] = calculate_smartproxy_cost(round(strlen($raw_html) / 1024, 2), 'unblocker');
|
||||
} else {
|
||||
@@ -195,7 +191,8 @@ private static function minifyAndCleanHtml(string $raw_html)
|
||||
return $crawler->html();
|
||||
}
|
||||
|
||||
private static function minifyHTML($input) {
|
||||
private static function minifyHTML($input)
|
||||
{
|
||||
// Remove extra white space between HTML tags
|
||||
$input = preg_replace('/>\s+</', '><', $input);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user