Ja ist ersteres.unklar, ob Start und Endedatum einbezogen oder ausgeschlossen sind (wahrscheinlich ersteres) etc.
Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature currently requires accessing the site using the built-in Safari browser.
Ja ist ersteres.unklar, ob Start und Endedatum einbezogen oder ausgeschlossen sind (wahrscheinlich ersteres) etc.
test-get-json.json
sondern habe mir via php /pfad/zur/datei.php >> test_file.txt
das ergebnis ausgeben lassen.test-get-json.json
sieht so aus:[
[],
[],
[],
[],
[
{
"id": 259630312,
"url": "http://www.publisher.com",
"advertiserId": 7052,
"publisherId": 189069,
"commissionSharingPublisherId": 55555,
"commissionSharingSelectedRatePublisherId": 189069,
"campaign": "campaign name"
"siteName": "Publisher",
"commissionStatus": "pending",
"commissionAmount": {
"amount": 5.59,
"currency": "GBP"
},
"saleAmount": {
"amount": 55.96,
"currency": "GBP"
},
"ipHash": "-66667778889991112223",
"customerCountry": "GB",
"clickRefs": {
"clickRef": "12345",
"clickRef2": "22222",
"clickRef3": "33333",
"clickRef4": "44444",
"clickRef5": "55555",
"clickRef6": "66666"
},
"clickDate": "2017-01-23T12:18:00",
"transactionDate": "2017-02-20T22:04:00",
"validationDate": null,
"type": "Commission group transaction",
"declineReason": null,
"voucherCodeUsed": true,
"voucherCode": "example123",
"lapseTime": 2454307,
"amended": false,
"amendReason": null,
"oldSaleAmount": null,
"oldCommissionAmount": null,
"clickDevice": "Windows",
"transactionDevice": "Windows",
"publisherUrl": "http://www.publisher.com/search?query=dvds",
"advertiserCountry": "GB",
"orderRef": "111222333444",
"customParameters": [
{
"key": "1",
"value": "555666"
},
{
"key": "2",
"value": "example entry"
},
{
"key": "3",
"value": "LLLMMMNNN"
}
],
"transactionParts": [
{
"commissionGroupId": 12345,
"amount": 44.76,
"commissionAmount": 4.50,
"commissionGroupCode": "DEFAULT",
"commissionGroupName": "Default Commission"
}
{
"commissionGroupId": 654321,
"amount": 11.20,
"commissionAmount": 1.50,
"commissionGroupCode": "EXISTING",
"commissionGroupName": "EXISTING"
}
],
"paidToPublisher": false,
"paymentId": 0,
"transactionQueryId": 0,
"originalSaleAmount": null
}
]
],
[],
[],
[],
[],
[],
[],
[],
[]
]
for ($i = 0; $i < 13; $i++) {
// prepare start and end time and URL:
$start_date = $dateObj->format('Y-m-d');
$dateObj->modify('+30 days');
$end_date = $dateObj->format('Y-m-d');
$url = 'https://webentwicklung.ulrichbangert.de/testget-json.php?startDate=' . $start_date . 'T00%3A00%3A00&endDate=' . $end_date . 'T00%3A00%3A00&timezone=Europe/Berlin&dateType=transaction';
echo 'url=' . $url . '<br>';
// fetch from API by use of curl:
$ch = curl_init($url) or die($current_datetime . " - " . $script_name . " - Couldnt reach endpoint \n");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$data = curl_exec($ch);
echo 'response=' . $data . '<br>';
$data = json_decode($data, true);
$responseArr[] = $data;
sleep(30);
}
Kann das nicht sein das Php da in den Timeout geht ?Du musst nur aufpassen, weil dann das Skript relativ lange läuft: 30 * 13 sec plus die Antwortzeiten auf die API.
ja ist vielleicht die sicherere variante. ich habs jetzt auf jeden fall schonmal mit sleep(4) und 24 monaten laufen lassen. ist nicht in den timeout gegangen.Man könnte auch das Skript zyklisch aufrufen durch einen Cronjob mit 30 sec. Dann hättest Du das Problem mit der langen Laufzeit nicht.