misc.anonradio: hopefully fix bad titles from bad json formatting on icecast's end
This commit is contained in:
		
							parent
							
								
									fe7d7b86d3
								
							
						
					
					
						commit
						947a7baa44
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
					@ -281,9 +281,9 @@ anonradio.callback = async function (msg, line) {
 | 
				
			||||||
  const schedule = await fetch("https://anonradio.net/schedule/").then((res) =>
 | 
					  const schedule = await fetch("https://anonradio.net/schedule/").then((res) =>
 | 
				
			||||||
    res.text()
 | 
					    res.text()
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
  const icecast = await fetch("http://anonradio.net:8010/status-json.xsl").then(
 | 
					  const icecast = await fetch("http://anonradio.net:8010/status-json.xsl")
 | 
				
			||||||
    (res) => res.json()
 | 
					    .then((res) => res.text())
 | 
				
			||||||
  );
 | 
					    .then((data) => JSON.parse(data.replace(/"title":-,/g, '"title":"-",')));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  let lines = schedule.split("\n");
 | 
					  let lines = schedule.split("\n");
 | 
				
			||||||
  lines = lines.slice(4, lines.length - 2);
 | 
					  lines = lines.slice(4, lines.length - 2);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue