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.
This commit is contained in:
gmemstr 2017-06-19 19:45:51 -07:00
parent 0ffefbf55e
commit 29db0f76c5
4 changed files with 14 additions and 7 deletions

View file

@ -10,9 +10,11 @@
<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);
@ -23,7 +25,8 @@ get("/json", function(data){
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>';
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);

View file

@ -1,4 +1,9 @@
body {
background-color: #f9f9f9;
color: #5b9aff;
}
font-family: monospace;
}
.podcast {
background-color: white;
padding:5%;
}

View file

@ -68,7 +68,7 @@ func generate_rss() {
feed.Items = []*feeds.Item{
&feeds.Item{
Title: title,
Link: &feeds.Link{Href: "https://gitgalaxy.com/podcast"},
Link: &feeds.Link{Href: "https://podcast.gitgalaxy.com/download/" + file.Name(), Length: "100", Type: "audio/mpeg"},
Enclosure: &feeds.Enclosure{Url: "https://podcast.gitgalaxy.com/download/" + file.Name(), Length: "100", Type: "audio/mpeg"},
Description: "Hello, World!",
Author: &feeds.Author{Name: "Gabriel Simmer", Email: "gabriel@gitgalaxy.com"},

View file

@ -1 +0,0 @@
hello