Singpolyma

Archive for January, 2006

Archive for January, 2006

Comment Aggregation

Posted on

There has been much discussion recently about comment syndication. I have made some of my own contributions to this, including Commentosphere and Blogger Recent Comments. While all of this is good and useful in its own way, syndication is useless without aggregation.

Currently, to track comments for interesting discussion / replies to your own you must subscribe to many comments feeds from different blogs and posts. This will quickly clutter your feedreader even if you only subscribe to the ones that are most important. Something that can help this, at least a little, is combining the feeds together into one megafeed, using something like feedshake or the Commentosphere Aggregator (see my aggregator for an example). While this works to some degree, it is ultimately unsatisfactory.

So here’s the idea — have feed readers aggregate comments alongside the post. A post then appears unread if it has unread comments as well as if it is itself unread. The new comments are highlighted on viewing the feed and marked unread. Another possibility would be to have a little ‘comments’ icon next to the post title that shows if there are no comments, new comments, or all read comments on a post. Clicking the icon would bring up the comments for that post (likely within the aggragator, not just a link to the # or anything like that).

This whole idea does, of course, assume that the aggregator can get to the comments somehow. There needs to be some way to take the link URL (usually to the post page) and get the comments feed URL for that post. (Assuming there is one. If there isn’t, that’s in the realm of syndication, not aggregation.) To facilitate this, I am proposing a simple piece of standard markup. Most blogs that have comments feeds for every post have a link to that feed somewhere on the post page. If we made it standard protocol to set rel=”alternate comments” (obviously, just like with relTag, you can have other things in the rel-list as well, but require both of these) for these links, the aggregators could pull them out of the page and get the appropriate URL. The aggregator could then get the comments feeds and use them to produce the features outlined above.

New Backlinks Hack

Posted on

My previous backlinks hack was a quick fix to allow backlinks on the main page, since I wanted to do that. It was, however, kind of ugly, complicated, and like the ‘normal’ backlinks code broke XML well-formedness. I have, therefore, come up with a new hack that does the exact same thing, but is faster, easier, and XHTML valid. The new steps are below :

  1. Enable backlinks on your blog — an obvious, but necessary, step
  2. Put this code in the <head> section of your blog template:
    <script type=”text/javascript”>
    //<![CDATA[

    function toggleitem(postid,linkid,newtxt,displaytype) {
    if(!displaytype) {displaytype = ‘block’;}
    var whichpost = document.getElementById(postid);
    if (whichpost.style.display != “none”) {
    whichpost.style.display = “none”;
    } else {
    whichpost.style.display = displaytype;
    }
    if(linkid) {
    var lnk = document.getElementById(linkid);
    lnk.href = “javascript:toggleitem(‘”+postid+”‘,'”+linkid+”‘,'”+lnk.innerHTML+”‘);”;
    lnk.innerHTML = newtxt;
    }
    }

    //]]>
    </script>

  3. Find the section in your template that starts with <BlogItemBacklinksEnabled> and ends with </BlogItemBacklinksEnabled> and replace the entire thing (these tags included) with this code:
    <BlogItemBacklinksEnabled>
    <ItemPage><div style=”display:block;” id=”backlinks”></ItemPage>
    <MainOrArchivePage><div style=”display:none;” id=”backlinks<$BlogItemNumber$>”></MainOrArchivePage>
    <h4>Backlinks:</h4>
    <script type=”text/javascript”>backlink = new Array();BL_Backlinks = new Array();</script>
    <script type=”text/javascript” src=”http://www.blogger.com/dyn-js/backlink.js?blogID;$BlogID$>&amp;postID=<$BlogItemNumber$>”></script>
    <script type=”text/javascript”>
    //<![CDATA[
    for(var i = 0; i < BL_Backlinks.length; i++) {
    document.write(‘<dt class=”comment-title”>’);
    document.write(‘<span class=”comment-toggler”>&nbsp;</span>’);
    document.write(‘<a href=”‘+BL_Backlinks[i][“BlogBacklinkURL”]+'”>’+BL_Backlinks[i][“BlogBacklinkTitle”]+'</a>’);
    document.write(‘</dt>’);
    document.write(‘<dd class=”comment-body”>’+BL_Backlinks[i][“BlogBacklinkSnippet”]);
    document.write(‘<br />’);
    document.write(‘<span class=”comment-poster”>’);
    document.write(‘<em>posted by ‘+BL_Backlinks[i][“BlogBacklinkAuthor”]+’ @ ‘+BL_Backlinks[i][“BlogBacklinkDateTime”]+'</em>’);
    document.write(‘</span>’);
    document.write(‘</dd>’);
    }//end for
    //]]>
    </script>
    <p class=”comment-timestamp”><a class=”comment-link” href=”javascript:BlogThis();”>Create a Link</a></p>
    </div>
    </BlogItemBacklinksEnabled>
  4. Find the code for the ‘links to this post’ link in your post footer template code and replace it with ‘<a href=”<$BlogItemPermalinkUrl$>#backlinks” onclick=”toggleitem(‘backlinks<MainOrArchivePage><$BlogItemNumber$></MainOrArchivePage>’);return false;”>links to this post</a>
  5. Save your template and republish your blog!
http://del.icio.us/singpolyma.techblog/hacks

FeedXS : RSS can do anything

Posted on

FeedXS is the proof that RSS is beyond blogging. Where exactly it is, we’re not sure, however. FeedXS allows you to create RSS feeds through an MSN contact. Sign up for an account, add them to your MSN and ‘log in’. After that, everything you say to that contact goes in your feed. I’m not 100% sure how this is useful… or if it is useful. It might be if you could add the contact to a group conversation to keep track of it later, but even then I’m not sure… This is beyond blogging, and I’m sure the because-it’s-cool people will find all sorts of weird and wonderful uses for it… maybe even me 😉

Google Talk With Other IMs

Posted on

Google Talk has been opened to communicate with other XMPP IM services! One of the complaints against it when it first launched was that it used the open XMPP protocol, but was a closed system. No longer. This is a smart, and a useful, move for them. Hopefully they’ll add MSN/AIM/ICQ integration eventaully as well…

Tags:

Commentosphere Blogger Integration

Posted on

I have finalised the first version of a template hack for Blogger that inlines Commentosphere data for comments on your blog. This allows you to make better use of the semi-threading features of Commentosphere. Insert only the code snippets for the data you want (the first two are invisible and mandatory).

  1. Insert this code somewhere in the post section of your template (it is invisible, so it doesn’t matter where):
    <script type=”text/javascript”>
    //<![CDATA[
    posturl = ‘<$BlogItemPermalinkUrl$>’;
    //]]>
    </script>
  2. Insert this code right after your <BlogItemComments> tag:
    <script type=”text/javascript”>
    //<![CDATA[
    csdata = {};
    for(var i=0; i<Commentosphere.posts.length; i++) {
    if(Commentosphere.posts[i].url == posturl+’#c<$BlogCommentNumber$>’ || Commentosphere.posts[i].url == posturl+’#<$BlogCommentNumber$>’) {
    csdata = Commentosphere.posts[i];
    break;
    }//end if url == this
    }//end for
    //]]>
    </script>
  3. Insert this code where you want the links to parents of the comment (if there are any) to show up:
    <script type=”text/javascript”>
    //<![CDATA[
    if(csdata.parents && csdata.parents[0] != ”) {
    document.write(‘(‘);
    for(var i=0; i<csdata.parents.length; i++) {
    if(i > 0)
    document.write(‘ | ‘);
    parenturl = ‘#’+csdata.parents[i].split(‘#’)[1];
    document.write(‘<a href=”‘+parenturl+'”>parent #’+(i+1)+'<\/a>’);
    }//end for
    document.write(‘)’);
    }//end if
    //]]>
    </script>
  4. Insert this code where you want the links to replies to the comment (if there are any) to show up:
    <script type=”text/javascript”>
    //<![CDATA[
    if(csdata.children && csdata.children[0] != ”) {
    for(var i=0; i<csdata.children.length; i++) {
    if(i > 0)
    document.write(‘ | ‘);
    childurl = ‘#’+csdata.children[i].split(‘#’)[1];
    document.write(‘<a href=”‘+csdata.children[i]+'”>reply #’+(i+1)+'<\/a>’);
    }//end for
    }//end if
    //]]>
    </script>
  5. Insert this code where you want the link to the comment on Commentosphere and tags to show up:
    <script type=”text/javascript”>
    //<![CDATA[
    if(csdata.id) {
    document.write(‘ <a href=”http://comment.ning.com/index.php?id Commentosphere</a> ‘);
    }//end if
    if(csdata.tags && csdata.tags[0] != ”) {
    document.write(‘ – Tags: ‘);
    for(var i=0; i<csdata.tags.length; i++) {
    document.write(‘ <a href=”csdata.id[i]+'”>’+csdata.tags[i]+'<\/a> ‘);
    }//end for
    }//end if
    //]]>
    </script>
  6. Save your template and republish your blog
http://del.icio.us/singpolyma.techblog/blogger