JSFiddle - React, Tailwind, and code Playground
HTML
<h2>Recent CPAN Releases for DWHEELER</h2>
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
$.ajax({
url: 'http://api.metacpan.org/dist/_search?q=author:dwheeler',
type: 'get',
dataType: 'jsonp',
success: function (data) {
var i, dist, dl;
if ( data.hasOwnProperty('hits') &&
data.hits.hasOwnProperty('hits')
) {
dl = $('<dl />').appendTo('body');
for ( i in data.hits.hits ) {
if ( data.hits.hits[i].hasOwnProperty('_source') ) {
dist = data.hits.hits[i]._source;
if ( dist.hasOwnProperty('name') &&
dist.hasOwnProperty('distvname') &&
dist.hasOwnProperty('abstract')
) {
$('<dt />')
.html('<a href="http://beta.metacpan.org/release/DWHEELER/' + dist.distvname + '">' + dist.name + '</a>')
.appendTo(dl);
$('<dd />')
.html(dist.abstract)
.appendTo(dl);
}
}
}
}
}
});