aboutsummaryrefslogtreecommitdiff
path: root/assets/php/getJson.php
diff options
context:
space:
mode:
authorMarvin Borner2018-06-21 18:34:57 +0200
committerMarvin Borner2018-06-21 18:34:57 +0200
commitc4dd258f2a49f5d72aadd75e92918f75f1a528f2 (patch)
treed0c0bb2b0c17ec5bb873a90ff8d8cab05c735678 /assets/php/getJson.php
parent52fdffc06ae449e4a1f0c57adf95412312e42224 (diff)
Added most watched chart
Diffstat (limited to 'assets/php/getJson.php')
-rwxr-xr-xassets/php/getJson.php28
1 files changed, 0 insertions, 28 deletions
diff --git a/assets/php/getJson.php b/assets/php/getJson.php
deleted file mode 100755
index fbbecac..0000000
--- a/assets/php/getJson.php
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-$NetflixCookie = $_POST["Cookie"];
-
-$LastPage = FALSE;
-$CurPage = 0;
-$NetflixJson = "[";
-
-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"]) . ",";
- } else {
- $LastPage = TRUE;
- $NetflixJson = substr($NetflixJson, 0, -1);
- }
-
- curl_close($ch);
- $CurPage++;
-}
-
-print_r($NetflixJson . "]"); \ No newline at end of file