Skip to content

Instantly share code, notes, and snippets.

@jakl
Last active December 17, 2015 18:18
Show Gist options
  • Save jakl/5651676 to your computer and use it in GitHub Desktop.
Save jakl/5651676 to your computer and use it in GitHub Desktop.
citation hackathon
<!DOCTYPE html>
<meta charset="utf-8">
<head>
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
</head>
<body>
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script src="http://code.jquery.com/jquery-2.0.1.min.js"></script>
<script src="index.js"></script>
<div id="citations"></div>
</body>
var params = {
book: "bible",
citation: "Gen. 1:1"
};
url = "http://cskit-server.herokuapp.com/v1/lesson/text.json?callback=?&";
url += "payload=[%7B%22section%22:1,%22readings%22:%7B%22{{book}}%22:[%22{{citation}}%22]%7D%7D]";
//Use mustache here once it works...
url = url.replace('{{book}}', params.book);
url = url.replace('{{citation}}', params.citation);
$.getJSON(url).done(function(data){
console.log(data);
$('#citations').text(data);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment