aboutsummaryrefslogtreecommitdiff
path: root/assets/php/getNetflixJson.php
diff options
context:
space:
mode:
Diffstat (limited to 'assets/php/getNetflixJson.php')
-rwxr-xr-xassets/php/getNetflixJson.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/assets/php/getNetflixJson.php b/assets/php/getNetflixJson.php
index dcfc4de..3a2fbe4 100755
--- a/assets/php/getNetflixJson.php
+++ b/assets/php/getNetflixJson.php
@@ -7,23 +7,23 @@
$NetflixCookie = $_POST["Cookie"];
-$LastPage = FALSE;
+$LastPage = false;
$CurPage = 0;
$NetflixJson = "[";
-while ($LastPage === FALSE) {
- $ch = curl_init("https://www.netflix.com/api/shakti/7742b8c7/viewingactivity?pg=" . (string)$CurPage . "&pgSize=100");
+while ($LastPage === false) {
+ $ch = curl_init("https://www.netflix.com/api/shakti/7742b8c7/viewingactivity?pg=" . (string) $CurPage . "&pgSize=100");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_COOKIE, $NetflixCookie);
$Result = curl_exec($ch);
//print_r((json_decode($Result, TRUE)["viewedItems"]));
//echo count(json_decode(curl_exec($ch),true)["viewedItems"]);
- if ($LastPage = count(json_decode($Result, TRUE)["viewedItems"]) > 0) {
- $LastPage = FALSE;
- $NetflixJson .= json_encode(json_decode($Result, TRUE)["viewedItems"]) . ",";
+ if ($LastPage = count(json_decode($Result, true)["viewedItems"]) > 0) {
+ $LastPage = false;
+ $NetflixJson .= json_encode(json_decode($Result, true)["viewedItems"]) . ",";
} else {
- $LastPage = TRUE;
+ $LastPage = true;
$NetflixJson = substr($NetflixJson, 0, -1);
}
@@ -31,4 +31,4 @@ while ($LastPage === FALSE) {
$CurPage++;
}
-print_r($NetflixJson . "]"); \ No newline at end of file
+print_r($NetflixJson . "]");