new things hope this works
This commit is contained in:
@@ -28,7 +28,7 @@ class FighterImporter {
|
||||
* Array of all fighters.
|
||||
* @var array[]
|
||||
*/
|
||||
protected $fighters = [];
|
||||
public $fighters = [];
|
||||
|
||||
/**
|
||||
* The current weight class.
|
||||
@@ -160,9 +160,19 @@ class FighterImporter {
|
||||
// Here you are Dan.
|
||||
// Implement caching to store instead of needing fresh requests.
|
||||
for ($i=0; $i<=100; $i++) {
|
||||
$ua = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4.1 Safari/605.1.15';
|
||||
$headers = [
|
||||
'referer' => true,
|
||||
'verify' => false,
|
||||
'headers' => [
|
||||
'User-Agent' => 'DC SCRAPER/v1.0',
|
||||
'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
|
||||
'Accept-Encoding' => 'gzip, deflate, br',
|
||||
]
|
||||
];
|
||||
$url = $base_url . "&page=$i";
|
||||
$cid = "ufc:" . $url;
|
||||
$request = $this->httpClient->request('GET', $url, ['verify' => false]);
|
||||
/* $cid = "ufc:" . $url; */
|
||||
$request = $this->httpClient->request('GET', $url, $headers);
|
||||
$content = $request->getBody()->getContents();
|
||||
$check = strpos($content, "No Result Found For");
|
||||
if (!$check) {
|
||||
@@ -174,6 +184,10 @@ class FighterImporter {
|
||||
}
|
||||
}
|
||||
|
||||
public function quickTest($str) {
|
||||
return "hello$str";
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract fighters from an html string.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user