'*************************************************************
'** Roku Xtream-ALL for XoceUnder
'** Copyright (c)2024 XoceUnder.  All rights reserved.
sub Init()
    m.top.functionName = "GetContent"
end sub

sub GetContent()
	http = NewHttp(ReadManifest().base_url+"/api.php")
	http.Method = "POST"
	http.AddParam("token", ReadManifest().api_key)
	response = http.Request()
	if len(response) > 0
	    json = ParseJson(response)
        if json <> invalid and json.Count() > 0 then 
		    if json[0].DoesExist("status")
			    m.top.response = json
			end if
            m.top.servers = json[0].app_dns
        else
            m.top.servers = []
        end if
    else
        m.top.servers = []
	end if
end sub
