JSFiddle - React, Tailwind, and code Playground
by wundersolutions
HTML
<h2>Recent CPAN Releases</h2>
<script type="text/javascript" src="http://api.metacpan.org/release/_search?q=release.author:DWHEELER&callback=cpan_distros">
</script>
CSS
body {
font-family: arial, helvetica, sans-serif;
font-size: 12px;
}
h2 {
color: #873725;
font-weight: bold;
font-size: 1.4em;
margin-bottom: 15px;
}
dt {
font-size: 1.05em;
font-weight: bold;
margin-bottom: 4px;
}
dt a {
color: #831818;
}
dt a:hover {
text-decoration: none;
}
dt a:visited {
color: #CC0000;
}
dd {
margin-bottom: 10px;
font-size: .95em;
}
JavaScript
function cpan_distros(data) {
document.write('<dl>');
for (i in data.hits.hits) {
var dist = data.hits.hits[i]._source;
document.write(
'<dt><a href="http://beta.metacpan.org/release/DWHEELER/' + dist.distvname +
'">' + dist.name + '</a></dt>' +
'<dd>' + dist.abstract + '</dd>');
}
document.write('</dl>');
}