var typeTemplate = `{{type}}` var template = `
{{name}} Language: {{language}} Version: {{version}} Authors: {{authors}} {{types}} {{description}}
` var rawRepoUrl = "https://raw.githubusercontent.com/ImZaw/cloudstream-extensions-arabic/builds/repo.json" $.getJSON( rawRepoUrl , function( data ) { var title = data.name $("#title").text(title) data.pluginLists.forEach(url => { $.getJSON( url , function( data ) { data.forEach(plugin => { var statusColor; var types = plugin.tvTypes?.map(tvType=> typeTemplate.replace("{{type}}", tvType)) if(plugin.status == 0) statusColor = "red"; else if(plugin.status == 1) statusColor = "green"; else statusColor = "yellow" $(".plugins > #grid").append( template .replace("{{icon_url}}", plugin.iconUrl?.replace("%size%", "128") ?? "https://cdn0.iconfinder.com/data/icons/file-management-system-flat/32/file_managemenr_system_icon_set_flat_style-14-512.png") .replace("{{status}}", statusColor) .replace("{{url}}", plugin.url) .replace("{{name}}", plugin.name) .replace("{{language}}", plugin.language) .replace("{{authors}}", plugin.authors?.join(",")) .replace("{{version}}", plugin.version) .replace("{{types}}", types.join("\n")) .replace("{{description}}", plugin.description ?? "") ) }) }) }); });