File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,11 +13,11 @@ public static function isHyperlink(string $text): bool
1313 return Str::startsWith (Str::lower ($ text ), ["https:// " , "http:// " ]);
1414 }
1515
16- public static function download (string $ text ): string
16+ public static function download (string $ text, string $ country = ' fr ' ): string
1717 {
1818 if (self ::isHyperlink ($ text )) {
1919 if (config ('towerify.scrapfly.api_key ' )) {
20- $ news = Http::get ('https://api.scrapfly.io/scrape?render_js=true&key= ' . config ('towerify.scrapfly.api_key ' ) . ' & url=' . $ text );
20+ $ news = Http::get ('https://api.scrapfly.io/scrape?render_js=true&asp=true&cache=true&cache_ttl=86400& key= ' . config ('towerify.scrapfly.api_key ' ) . " &country= { $ country } & url={ $ text}" );
2121 return json_decode ($ news , true )['result ' ]['content ' ];
2222 }
2323 if (config ('towerify.scraperapi.api_key ' )) {
You can’t perform that action at this time.
0 commit comments