Browse Source

mygpo source: Add microformats

master
Chimo 2 years ago
parent
commit
9a9e2c0d8e
1 changed files with 10 additions and 4 deletions
  1. +10
    -4
      sources/mygpo.js

+ 10
- 4
sources/mygpo.js View File

@ -11,7 +11,8 @@
html = "",
showdown = require( "showdown" ),
converter = new showdown.Converter(),
episodeDescHtml = "";
episodeDescHtml = "",
episodeDirectLink;
try {
json = JSON.parse( data );
@ -27,16 +28,21 @@
// TODO: Sanitize resulting HTML to be safe
episodeDescHtml = converter.makeHtml( item.episode.description );
episodeDirectLink = item.episode.direct_link;
event.title = "Listened to";
event.foreign_url = "https://podcasts.chromic.org/user/chimo";
html = "<div class='podcast'><h3 class='podcast__title'><a href='" +
item.podcast.homepage + "'>" + item.podcast.title + "</a></h3>";
html += "<div class='podcast__content episode'><h4 class='episode__title'>" +
"<a href='" + item.episode.homepage + "'>" + item.episode.title + "</a></h4>";
html += "<div class='podcast__content episode u-listen-of h-cite'><h4 class='episode__title'>" +
"<a class='p-name u-url' href='" + item.episode.homepage + "'>" + item.episode.title + "</a></h4>";
html += "<div class='p-summary'>" + episodeDescHtml;
html += episodeDescHtml + "</div></div>";
html += "<audio class='u-audio' src='" + episodeDirectLink + "' preload='none' controls='controls'>" +
"<a href='" + episodeDirectLink + "'>If possible, click to play, otherwise your browser may be unable to play this audio file.</a></audio></div></div></div>";
event.content = html;


Loading…
Cancel
Save