A
A
Alexey Orlov2020-02-20 12:27:28
YouTube
Alexey Orlov, 2020-02-20 12:27:28

How to increase the number of requests?

Not without difficulty, with the help of google, I wrote a script that displays the status of the stream on youtube (Online or Offline). But the problem is that the number of such requests is limited by youtube ~ 100 per day, but this is a very small number. Is there any way to get around this limitation?

function streamCheck() {
    $API_KEY = 'API_KEY';
    $ChannelID = 'ChannelID';

    $channelInfo = 'https://www.googleapis.com/youtube/v3/search?part=snippet&channelId='.$ChannelID.'&type=video&eventType=live&key='.$API_KEY;

    $extractInfo = file_get_contents($channelInfo);
    $extractInfo = str_replace('},]',"}]",$extractInfo);
    $showInfo = json_decode($extractInfo, true);

    if($showInfo['pageInfo']['totalResults'] === 0)
    {
        $result = 'Users channel is Offline';
    }
    else
    {
        $result = 'Users channel is LIVE!';
    }
    return $result;
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question