TikTok Live Checker

Status: Waiting

async function checkTikTokLive(){

const username=document.getElementById("ttUsername").value;

const res=await fetch("https://www.tiktok.com/oembed?url=https://www.tiktok.com/@"+username+"/live");

const text=await res.text();

if(text.toLowerCase().includes("live")){
document.getElementById("ttStatus").innerText="LIVE";
document.getElementById("ttStatus").style.color="green";
}else{
document.getElementById("ttStatus").innerText="NOT LIVE";
document.getElementById("ttStatus").style.color="red";
}

}