--- /dev/null
+
+function getRecentComments() {
+ let container = document.querySelector("#recent-comments-container");
+ console.log(container);
+
+ let request = new XMLHttpRequest();
+ request.open('GET', 'http://unremediatedgender.space/isso/latest?limit=5', true);
+
+ request.onload = function() {
+ if (this.status >= 200 && this.status < 400) {
+ let comments = JSON.parse(this.response);
+ console.log(comments);
+ for (let comment of comments.reverse()) {
+ let p = document.createElement('p');
+ let a = document.createElement('a');
+ let text = document.createTextNode(`${comment.author} on ${comment.uri}`);
+ a.appendChild(text);
+ a.href = `${comment.uri}#isso-${comment.id}`;
+ p.appendChild(a);
+ container.appendChild(p);
+ }
+ } else {
+ container.textContent = "(could not load recent comments)"
+ }
+ };
+
+ request.onerror = function() {
+ "(could not load recent comments)"
+ };
+
+ request.send();
+}
+
+document.addEventListener("DOMContentLoaded", function() {
+ getRecentComments();
+});
data-isso-reply-to-self="true"
data-isso-require-author="true"
data-isso-require-email="true"
+ data-isso-feed="true" {# TODO: why doesn't the feed link work?! #}
src="//unremediatedgender.space/isso/js/embed.min.js"></script>
<section id="isso-thread"></section>
<link rel="top" href="#" /><link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,300italic,400italic,600italic|Source+Code+Pro' rel='stylesheet' type='text/css'></link>
<link rel="stylesheet" href="{{ SITEURL }}/theme/css/{{ CSS_FILE }}" type="text/css" />
+ <script src="/theme/js/recent_comments.js"></script>
{% block scripts %}
{% endblock %}
{% endfor %}
</aside>
+ <aside class="recent-comments">
+ <h2>Recent Comments</h2>
+ <div id="recent-comments-container"></div>
+ </aside>
+
</div>
</div>