Cómo contar json en html span

Intento contar a mis miembros en discordia en mi sitio web con un intervalo de HTML.

No puedo conseguir que funcione

Código fuente: https://discordapp.com/api/guilds/366996506563051520/embed.json

Tengo un guión de barebones para ti, amigo. Solo insértalo en el de tu página.

   

¿Estás tratando de mostrar el recuento en el lapso?

 var JSON = {"channels": [{"position": 15, "id": "368447071637995520", "name": "Kanal 1 [Max 3]"}, {"position": 18, "id": "368447393114619912", "name": "Kanal 1 [Max 5]"}, {"position": 16, "id": "368447172338778112", "name": "Kanal 2 [Max 3]"}, {"position": 19, "id": "368447450513408020", "name": "Kanal 2 [Max 5]"}, {"position": 17, "id": "368447261539303446", "name": "Kanal 3 [Max 3]"}, {"position": 20, "id": "368447509414150144", "name": "Kanal 3 [Max 5]"}, {"position": 6, "id": "368446298522910721", "name": "Premium Kanal 1"}, {"position": 7, "id": "368446708306280448", "name": "Premium Kanal 2"}, {"position": 8, "id": "368446767471132685", "name": "Premium Kanal 3"}, {"position": 3, "id": "367002932807204864", "name": "\u2753 Trenger Hjelp"}, {"position": 4, "id": "367005226143842305", "name": "\u2754 Hjelpe rom 1"}, {"position": 5, "id": "367005348176855042", "name": "\u2754 Hjelpe rom 2"}, {"position": 12, "id": "367006728815902731", "name": "\ud83c\udfae Spill Kanal 1"}, {"position": 13, "id": "367006767684517889", "name": "\ud83c\udfae Spill Kanal 2"}, {"position": 14, "id": "367006802593841164", "name": "\ud83c\udfae Spill Kanal 3"}, {"position": 22, "id": "372107835389116417", "name": "\ud83c\udfb5 Music"}, {"position": 9, "id": "367002370388918292", "name": "\ud83d\udcde Kanal 1"}, {"position": 10, "id": "367002446146306050", "name": "\ud83d\udcde Kanal 2"}, {"position": 11, "id": "367002508268273685", "name": "\ud83d\udcde Kanal 3"}, {"position": 0, "id": "367007445660205057", "name": "\ud83d\udd10 Ledelsen"}, {"position": 1, "id": "367007363544383498", "name": "\ud83d\udd10 Staff 1"}, {"position": 2, "id": "367015859165593610", "name": "\ud83d\udd10 Staff 2"}], "instant_invite": "https://discordapp.com/invite/8ZPte4", "id": "366996506563051520", "members": [{"username": "Cp1987", "status": "idle", "avatar_url": "https://cdn.discordapp.com/avatars/241640752180887552/e6059ce87fc11dbf995c91e4036cd5e7.jpg", "avatar": "e6059ce87fc11dbf995c91e4036cd5e7", "discriminator": "2544", "id": "241640752180887552"}, {"username": "Cymares", "status": "dnd", "game": {"name": "Minecraft"}, "avatar_url": "https://cdn.discordapp.com/avatars/106126923385577472/63d8cbac498b4f6cfeb1a4c08a835aaf.jpg", "avatar": "63d8cbac498b4f6cfeb1a4c08a835aaf", "discriminator": "4892", "id": "106126923385577472"}, {"username": "Defcon70", "status": "idle", "avatar_url": "http://www.miximages.com/javascript/1.png", "avatar": null, "discriminator": "2936", "id": "365492912626073612"}, {"username": "EOlai", "status": "online", "avatar_url": "https://cdn.discordapp.com/avatars/310137542475513871/aaef1908f3531f7212a0b85b7824deb0.jpg", "avatar": "aaef1908f3531f7212a0b85b7824deb0", "discriminator": "1854", "id": "310137542475513871"}, {"username": "FredBoat\u266a\u266a", "status": "online", "bot": true, "game": {"name": "Say ;;help"}, "avatar_url": "https://cdn.discordapp.com/avatars/184405311681986560/f20c8d9639cd674652254af0ffd3e9d2.jpg", "avatar": "f20c8d9639cd674652254af0ffd3e9d2", "discriminator": "7284", "id": "184405311681986560"}, {"username": "Hawz", "status": "idle", "nick": "Byggepus", "avatar_url": "https://cdn.discordapp.com/avatars/173651756259999744/94a1928d2c5c0c4a5deee6a7dbd32a73.jpg", "avatar": "94a1928d2c5c0c4a5deee6a7dbd32a73", "discriminator": "8876", "id": "173651756259999744"}, {"username": "Johannern96", "status": "dnd", "avatar_url": "https://cdn.discordapp.com/avatars/162105042369904640/f0a3428a57f1f5488e092fa677b6a20b.jpg", "avatar": "f0a3428a57f1f5488e092fa677b6a20b", "discriminator": "1603", "id": "162105042369904640"}, {"username": "Jonas (GuttaFraGjerdrum)", "status": "idle", "avatar_url": "https://cdn.discordapp.com/avatars/287902961143906305/5addd74e9bdaebd4a4121b38e3549232.jpg", "avatar": "5addd74e9bdaebd4a4121b38e3549232", "discriminator": "3369", "id": "287902961143906305"}, {"username": "Marty", "status": "online", "nick": "Marty9_", "avatar_url": "http://www.miximages.com/javascript/60be07cee940f8f98abc79df424d0e1b.jpg", "avatar": "60be07cee940f8f98abc79df424d0e1b", "discriminator": "0960", "id": "227493463556489216"}, {"username": "MrAadde", "status": "idle", "avatar_url": "http://www.miximages.com/javascript/0.png", "avatar": null, "discriminator": "7015", "id": "305626866876678145"}, {"username": "Mrmax", "status": "idle", "avatar_url": "https://cdn.discordapp.com/avatars/293790449335009280/255a66982fe000966fc0051f249f28ea.jpg", "avatar": "255a66982fe000966fc0051f249f28ea", "discriminator": "6948", "id": "293790449335009280"}, {"username": "n0rthwindo", "status": "online", "avatar_url": "https://cdn.discordapp.com/avatars/190825560878874626/aa10bc6d74e0dc2f62829a4a3eff2091.jpg", "avatar": "aa10bc6d74e0dc2f62829a4a3eff2091", "discriminator": "6116", "id": "190825560878874626"}, {"username": "OfficialAndy", "status": "online", "game": {"name": "NoahCraft.no"}, "avatar_url": "https://cdn.discordapp.com/avatars/122778933065154564/921ce6330d8c7494d4dc18cc8099db0f.jpg", "avatar": "921ce6330d8c7494d4dc18cc8099db0f", "discriminator": "7219", "id": "122778933065154564"}, {"username": "Olapola", "status": "idle", "game": {"name": "Minecraft"}, "avatar_url": "https://cdn.discordapp.com/avatars/191303467162271744/cac577e184788bec5ec24997af17c6b0.jpg", "avatar": "cac577e184788bec5ec24997af17c6b0", "discriminator": "1182", "id": "191303467162271744"}, {"username": "Rythm", "status": "online", "bot": true, "avatar_url": "https://cdn.discordapp.com/avatars/235088799074484224/8917d25c11a6c155a81d54640c6fd35a.jpg", "avatar": "8917d25c11a6c155a81d54640c6fd35a", "discriminator": "3722", "id": "235088799074484224"}, {"username": "SoSanCo", "status": "idle", "avatar_url": "http://www.miximages.com/javascript/0.png", "avatar": null, "discriminator": "8110", "id": "359025090022604801"}, {"username": "Taboovector", "status": "online", "game": {"name": "Ben and Ed - Blood Party"}, "avatar_url": "https://cdn.discordapp.com/avatars/182508242725765120/65b9a4d9a93df15fdd3076ab87cc2509.jpg", "avatar": "65b9a4d9a93df15fdd3076ab87cc2509", "discriminator": "4829", "id": "182508242725765120"}, {"username": "Valpepusen", "status": "online", "avatar_url": "https://cdn.discordapp.com/avatars/329901346511781888/28c3b87171526bd5c03f1450e6e04e4e.jpg", "avatar": "28c3b87171526bd5c03f1450e6e04e4e", "discriminator": "6886", "id": "329901346511781888"}], "name": "SkyLands"}; var membersSpan = document.getElementById('members'); membersSpan.innerHTML = JSON.members.length; 
 

members.

Prueba este código Espero que te ayude

 string postURL = https://discordapp.com/api/guilds/366996506563051520/embed.json; var myRequest = System.Net.WebRequest.Create(postURL); myRequest.Method = "POST"; myRequest.ContentType = "application/json"; myRequest.GetRequestStream(); var response = (System.Net.HttpWebResponse)myRequest.GetResponse(); var data = response.GetResponseStream(); var streamRead = new StreamReader(data); var result = streamRead.ReadToEnd(); var count = result.Length; 

// Ahora pon var cuenta en span

Intereting Posts