]> git.leonardobizzoni.com Git - highschool-graduation-project/commitdiff
Finished live checker script
authorLeonardoBizzoni <leo2002714@gmail.com>
Fri, 20 May 2022 06:41:22 +0000 (08:41 +0200)
committerLeonardoBizzoni <leo2002714@gmail.com>
Fri, 20 May 2022 06:41:22 +0000 (08:41 +0200)
www/vtuberIsLive.php

index 563925a95777aa13e8f253073153f66dd0c53b61..4d5d6ba552c8d0a9311f0035fef67fe9870c509d 100644 (file)
@@ -49,6 +49,7 @@ while (true) {
             curl_close($ch);
 
             if (count($result["data"])) {
+                echo $login."\n";
                 $stmt = $app->db->pdo->prepare("update vtubers set live='twitch.tv/$login' where id=" . $vtuber["id"]);
                 $stmt->execute();
                 $isLive = true;
@@ -75,6 +76,7 @@ while (true) {
             for ($i = 0; $i < $length; $i++) {
                 $tag = $result->item($i)->getAttribute("href");
                 if (str_contains($tag, "https://www.youtube.com/watch?v=")) {
+                    echo $tag."\n";
                     $stmt = $app->db->pdo->prepare("update vtubers set live='$tag' where id=" . $vtuber["id"]);
                     $stmt->execute();
                     $isLive = true;