Last active
August 29, 2015 14:05
-
-
Save mgreensmith/cfdec5f1fde432a67624 to your computer and use it in GitHub Desktop.
Dockernews
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Dockernews</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> | |
</head> | |
<body> | |
<div class="container"> | |
<div class="row"> | |
<h3>Dockernews</h3> | |
</div> | |
<div class="row"> | |
<table class="table table-condensed" id='items_table'></table> | |
</div> | |
</div> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-timeago/1.4.0/jquery.timeago.min.js"></script> | |
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> | |
<script> | |
$.getJSON( "https://hn.algolia.com/api/v1/search_by_date?query=docker&tags=story", function( data ) { | |
var items = []; | |
$.each( data.hits, function(i , val) { | |
items.push( '<tr><td><small>' + jQuery.timeago(val.created_at) + '</small></td><td><a href="' + val.url + '">' + val.title + '</td></tr>' ); | |
}); | |
$("#items_table" ).html(items.join("")); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment