wip curl
This commit is contained in:
1 parent
d5eec39c6a
commit
6d8d5f9136
3 files changed
+10
-5
No files matched your search
@@ -218,7 +218,6 @@ class Curl
|
||||
82 => 'CURLE_SSL_CRL_BADFILE',
|
||||
83 => 'CURLE_SSL_ISSUER_ERROR',
|
||||
84 => 'CURLE_FTP_PRET_FAILED',
|
||||
84 => 'CURLE_FTP_PRET_FAILED',
|
||||
85 => 'CURLE_RTSP_CSEQ_ERROR',
|
||||
86 => 'CURLE_RTSP_SESSION_ERROR',
|
||||
87 => 'CURLE_FTP_BAD_FILE_LIST',
|
||||
|
||||
@@ -27,7 +27,7 @@ class Sofascore
|
||||
SofaScoreTournament::truncate();
|
||||
SofaScoreDay::truncate();
|
||||
SofaScoreCategorie::truncate();
|
||||
Notice::note('Table SofaScoreDayTournament, SofaScoreTournament, SofaScoreCategorie truncated', 'b', 1);
|
||||
Notice::note('Table SofaScoreDay, SofaScoreDayTournament, SofaScoreTournament, SofaScoreCategorie truncated!', 'b', 1);
|
||||
}
|
||||
|
||||
if ($debug) {
|
||||
|
||||
@@ -46,8 +46,6 @@ class Tournament
|
||||
Notice::note('Grapping Sport: '.Nuh::$options['sport'].' Day: '.$day, 'g');
|
||||
}
|
||||
|
||||
SofaScoreDay::updateOrCreate(['day' => $day], [$sport->ss_slug => 1]);
|
||||
|
||||
$page = 1;
|
||||
|
||||
while ($page) {
|
||||
@@ -59,7 +57,13 @@ class Tournament
|
||||
}
|
||||
usleep($rand);
|
||||
|
||||
$data = Curl::load($url);
|
||||
// $data = Curl::load($url);
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
$response = curl_exec($ch);
|
||||
$data = json_decode($response, true);
|
||||
|
||||
if ($data['hasNextPage']) {
|
||||
$page++;
|
||||
@@ -151,6 +155,8 @@ class Tournament
|
||||
|
||||
Notice::note("tournaments: $tournaments_counter", 'p');
|
||||
|
||||
SofaScoreDay::updateOrCreate(['day' => $day], [$sport->ss_slug => 1]);
|
||||
|
||||
}
|
||||
|
||||
if (Nuh::$options['test']) {
|
||||
|
||||
Reference in new issue
Block a user