pogo/assets/index.html
gmemstr 29db0f76c5 Changed Url in JSON to point directly to mp3 file
Used for embedding. This affecs the link in the RSS feed as well, although this should not be a big issue.
2017-06-19 19:45:51 -07:00

47 lines
1.2 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CMS Loading</title>
<link rel="stylesheet" href="/assets/styles.css">
</head>
<body>
<h1 id="title" class="title">Loading</h1>
<div id="podcasts">
</div>
<footer>
<p>White Rabbit licensed under the GPLv3</p>
</footer>
<script>
get("/json", function(data){
json = JSON.parse(data);
document.title = json.title;
document.getElementById("title").innerHTML = json.title;
for (i=0;i<json.items.length; i++){
var div = document.createElement('div');
div.className = 'podcast';
// Todo: Add audio element (must modify feeds fork first!)
div.innerHTML = '<h3>'+json.items[i].title+'</h3><p>'+json.items[i].summary+'</p>'+
'<audio controls><source src="'+json.items[i].url+'">';
var element = document.getElementById("podcasts");
element.appendChild(div);
}
});
function get(url, callback) {
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function() {
if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
callback(xmlHttp.responseText);
}
xmlHttp.open("GET", url, true);
xmlHttp.send(null);
}
</script>
</body>
</html>