Permalink
Browse files

modified Pinboard aside to only pull in articles with a given tag

  • Loading branch information...
codebykat committed May 20, 2013
1 parent d0c7459 commit 7718a6ce9d3a5b84dbc663547c878d26200842f0
Showing with 11 additions and 10 deletions.
  1. +4 −3 source/_includes/asides/pinboard.html
  2. +7 −7 source/javascripts/pinboard.js
@@ -1,13 +1,14 @@
{% if site.pinboard_user %}
<section>
<h1>My Pinboard</h1>
<ul id="pinboard_linkroll">Fetching linkroll...</ul>
<p><a href="http://pinboard.in/u:{{ site.pinboard_user }}">My Pinboard Bookmarks &raquo;</a></p>
<h1>Bookmarks</h1>
<ul id="pinboard_linkroll">Fetching bookmarks...</ul>
<p><a href="http://pinboard.in/u:{{ site.pinboard_user }}/t:{{ site.pinboard_tag }}">see more &raquo;</a></p>
</section>
<script type="text/javascript">
var linkroll = 'pinboard_linkroll'; //id target for pinboard list
var pinboard_user = "{{ site.pinboard_user }}"; //id target for pinboard list
var pinboard_count = {{ site.pinboard_count }}; //id target for pinboard list
var pinboard_tag = "{{ site.pinboard_tag }}"; //id target for pinboard list
(function(){
var pinboardInit = document.createElement('script');
pinboardInit.type = 'text/javascript';
@@ -41,16 +41,16 @@ function Pinboard_Linkroll() {
if (it.n) {
str += "<span class=\"pin-description\">" + this.cook(it.n) + "</span>\n";
}
if (it.t.length > 0) {
for (var i = 0; i < it.t.length; i++) {
var tag = it.t[i];
str += " <a class=\"pin-tag\" href=\"https://pinboard.in/u:"+ this.cook(it.a) + "/t:" + this.cook(tag) + "\">" + this.cook(tag).replace(/^\s+|\s+$/g, '') + "</a> ";
}
}
// if (it.t.length > 0) {
// for (var i = 0; i < it.t.length; i++) {
// var tag = it.t[i];
// str += " <a class=\"pin-tag\" href=\"http://pinboard.in/u:"+ this.cook(it.a) + "/t:" + this.cook(tag) + "\">" + this.cook(tag).replace(/^\s+|\s+$/g, '') + "</a> ";
// }
// }
str += "</p></li>\n";
return str;
}
}
Pinboard_Linkroll.prototype = new Pinboard_Linkroll();
pinboardNS_fetch_script("https://feeds.pinboard.in/json/v1/u:"+pinboard_user+"/?cb=pinboardNS_show_bmarks\&count="+pinboard_count);
pinboardNS_fetch_script("http://feeds.pinboard.in/json/u:"+pinboard_user+"/t:"+pinboard_tag+"/?cb=pinboardNS_show_bmarks\&count="+pinboard_count);

0 comments on commit 7718a6c

Please sign in to comment.