Singpolyma

Technical Blog

Archive for the "Tech" Category

Comment Feeds Without Well-formedness

Posted on

In response to the popular confusion about XML well-formedness and a recent nudgeing by Greg, I have upgraded Blogger Recent Comments. People who have been there before will note that there is now one less instruction — XML well-formedness is no longer necessary! I have tested this with a Blogger template on which I purposely broke well-formedness and the comments still came through fine! Originally introduced on this blog, Blogger Recent Comments is a Ning app that can automatially generate RSS, JavaScript, and JSON feeds of all comments on your blog. Setup is now just three easy steps!

Blogger del.icio.us categorising, pinging, and trackback helper

Posted on

I have a version of this script for the new Blogger as well.

Many people have installed Johan Sundström’s del.icio.us Categoriser Script and reaped the benefits. Some have also used my trackback script to enable outbound trackback inside Blogger. Now the power of these two scripts comes together to benefit everyone!

With Johan’s full approval I have married the two scripts into one categoriser and trackback script. This script is set up in such a way that installing it should overwrite any previous installation of Johan’s script and keep your existing script settings. To find out more about the categorising and pinging functions of the script, please read Johan’s post.

The trackback features work slightly differently than they did in my previous script. On the post-create page there is now a ‘Trackback’ textarea, instead of a form on the ‘post complete’ page. Enter one or more trackback URLs (each on it’s own line in the textarea) to use the trackack feature. After publishing the post your trackbacks will be sent out automatically and the status will be displayed on the ‘post complete’ page. For more information on trackback, go to Wikipedia.

There are also a couple minor new features for the categorising in this release. One is the option to use the first 200 characters of the post body in the extended field on del.icio.us, instead of the datestamp. The ‘Tags:’ label that one clicks to change settings is now blue, and your cursor should change into a hand when hovering it. Also, when republishing your whole blog the link to del.icio.us from your last post will not be displayed.

Install the Greasemonkey Script

Singpolyma Templates

Posted on

For templates for the new Blogger see the updated post.

Due to some of the feedback I’ve been getting from hack implementors recently I have decided to roll out my own set of templates for Blogger, implementing various and sundry features that different persons have expressed interest in. These templates are all loosely based on the Blogger Minima concept, with some inspiration from my blog also. They have been written from scratch, however, and all have the following features:

So, if you’re looking for a new template, or just want some of these features or some of those that follow, this is for you.

If anyone wants another version of this template created (ie, some combination of the hacks, or for another hack) feel free to contact me. If anyone has any ideas or feedback at all concerning the usefulness of / look of these templates, again, I have an open ear. I would ask that you keep your comments positive. ‘This Sucks!’ is not all that helpful to me, even if that’s how you feel 😉

Notes to advanced users: Hopefully these templates will also be useful to you in examining my code, etc. To remove peek-a-boo from comments or backlinks in any of the above templates, simply remove the onclick handler from the appropriate link. It should also be mentioned that these templates all support both versions of blogger comment permalinks. If you have any questions about the features on these templates I’m just an email/comment away!

Asynchronous Comment Form

Posted on

See this page for a similar hack for the new version of Blogger.

This hack does not work with Blogger BETA.

This is a new, partly experimental, upgrade to my inline comments form. Credit goes to Aditya of The Last Word for inspiring this hack. Comments are posted without ever leaving the post page and then the page is reloaded. You never see the Blogger comment page unless there is an error. The form is still coComment compatible and supports posting using your Blogger account 🙂

  1. Word verification for comments must be turned off (to do this go to the ‘comments’ tab in your blog settings, scroll to ‘Show word verification for comments?’ and select ‘No’)
  2. Turn comment posting by anonymous users on (to do this go to the ‘comments’ tab in your blog settings, scroll to ‘Who Can Comment?’ and select ‘Anyone’)
  3. Insert the following code into the <head> section of your blog template :
    <script type=”text/javascript” src=”http://jscripts.ning.com/get.php?xn_auth=no&amp;id=1338954;
    <script type=”text/javascript”>
    //<![CDATA[
    var comment_form_template = ‘<div class=”comment-poster”>[[AUTHOR]]</div>\n’
    + ‘<div class=”comment-body”><div class=”innerCmntBody”>[[BODY]]</div></div>\n’
    + ‘<div class=”comment-timestamp”><a href=”[[PERMALINK]]” title=”comment permalink”>[[DATE]]</a></div>\n’;
    //]]>
    </script>

  4. Insert the following code directly after your <body> tag:
    <iframe id=”comment_form_target” name=”comment_form_target” style=”display:none;” onload=”if(comment_form) {check_comment_posted();}”></iframe>
  5. Replace the <$BlogItemCreate$> tag with the following code:
    <div id=”comment_form_preview<$BlogItemNumber$>”></div>

    <ItemPage>
    <script type=”text/javascript”>

    var blogTool = “Blogger”;
    var blogURL = “<$BlogURL$>/”;
    var blogTitle = “<$BlogTitle$>”;
    var postURL = “<$BlogItemPermalinkUrl$>”;
    var postTitle = “<BlogItemTitle><$BlogItemTitle$></BlogItemTitle>”;
    var commentAuthorFieldName = “anonName”;
    var commentAuthorLoggedIn = “false”;
    var commentFormID = “cformtag<$BlogItemNumber$>”;
    var commentTextFieldName = “postBody”;
    var commentButtonName = “post”;
    var cocomment_force = false;

    </script>
    <script id=”cocomment-fetchlet” type=”text/javascript” src=”http://www.cocomment.com/js/cocomment.js </script>
    </ItemPage>

    <ItemPage><a href=”javascript:toggleitem(‘cform’);”>Post a Comment</a>
    <div style=”display:block;” id=”cform”></ItemPage>
    <MainOrArchivePage><a href=”javascript:toggleitem(‘cform<$BlogItemNumber$>’);”>Post a Comment</a>
    <div style=”display:none;” id=”cform<$BlogItemNumber$>”></MainOrArchivePage>
    <form target=”comment_form_target” id=”cformtag<$BlogItemNumber$>” action=”http://www.blogger.com/login-comment.do onsubmit=”comment_form_submit(this);isSubmit=true;” method=”post”><div>
    <input type=”hidden” name=”blogID” value=”<$BlogID$>” />
    <input type=”hidden” name=”postID” value=”<$BlogItemNumber$>” />
    <div>
    <h2 class=”sidebar-title form-title”><label class=”cbody”>Leave your comment </label></h2>
    <h2 class=”sidebar-title”> You can use some HTML tags, such as <b> &lt;b&gt;, &lt;i&gt;, &lt;a&gt; </b> </h2>
    <textarea name=”postBody” class=”comment” rows=”8″ cols=”40″ onkeyup=”comment_form_preview(this.form);”></textarea>
    <h2 class=”sidebar-title identity”> Choose an identity </h2>
    <div>
    <div>
    <input id=”idenBlogger<$BlogItemNumber$>” type=”radio” name=”iden” value=”Blogger” checked=”checked” onchange=”toggleitem(‘cfo<$BlogItemNumber$>’);comment_form_preview(this.form);” />
    <label> Your Blogger display name </label>
    </div>
    <div>
    <input type=”radio” name=”iden” value=”Other” onchange=”toggleitem(‘cfo<$BlogItemNumber$>’);comment_form_preview(this.form);” />
    <label>Other</label>
    <div style=”display:none;” id=”cfo<$BlogItemNumber$>”>
    <table style=”margin-left: 4em;” cellpadding=”0″ cellspacing=”0″>
    <tr> <td colspan=”2″ style=”padding-top:.4em;position:relative;left:-4em;” align=”left”> These fields are optional, but I would appreciate it if you filled them out. </td></tr>
    <tr> <td> <label> Name </label> </td>
    <td> <div class=”errorbox-good”> <input type=”text” name=”anonName” value=”” maxlength=”100″ class=”text” /> </div> </td> </tr>
    <tr> <td> <label> Your web page </label> </td>
    <td> <div class=”errorbox-good”> <input type=”text” name=”anonURL” value=”” maxlength=”100″ class=”text” /> </div> </td> </tr>
    </table>
    </div>
    </div>
    <div class=”diff-user”> Or you can sign in <a href=”http://www.blogger.com/login.g?r=http%3A%2F%2Fwww.blogger.com%2Fcomment.g%3FblogID%3D;$BlogID$>%26postID%3D<$BlogItemNumber$>”> as a different user</a>.</div>
    </div>
    </div>
    <div class=”errorbox-good”> </div>
    <p class=”buttons”>
    <input style=”margin-right:.3em” name=”post” value=”Publish Your Comment” class=”publish” type=”submit” tabindex=”2″ />
    <input value=”Preview” type=”submit” name=”preview” tabindex=”3″ />
    </p>
    </div></form>
    </div>

  6. Save your template and republish your blog

Note to advanced users : The variable set in step 3 is the template used by the script to generate previews. You can modify it to be closer to the code generated for comments on your blog so that users get a better preview 🙂 Some may also wish to browse the JavaScript source.

Survey: The Perfect Blogging Service

Posted on

You know what you want from your blogging service. If you use Blogger, you may have written a ‘Beef up Blogger‘-style post, even. Or a Beef up WordPress post without depending on services like WebCitz. Or maybe even a Beef up Xanga post (yes, there are some real bloggers on Xanga). I at one point even had a rating breakdown to see how well blogging services matched up to my ideal! While my opinions have changed over time, one thing still remains – no service is perfect. No matter what you use there are things you wish your service could do. That’s why we have blog hacks!

This post is a survey. What is the perfect blogging service? We’re all going to answer differently, but hopefully some patterns will emerge. What features are important? Forget for a moment what is supported by your particular platform and just tell us what you want. Not what you wish you had, but what you want even if you have it. Trackback can be important to you even if you use WordPress. Maybe that’s why you’re using WordPress.

The purpose of this survey is not to determine one particular existing service that is the ‘perfect blogging service’, but rather to identify the feature set that is important to bloggers.

You can respond to this survey by leaving a comment on this post (probably preferred) or by writing a post on your blog and linking back here. I don’t trust blog search or backlinks, so I’d really appreciate trackback pings if you decide on the latter, or a comment with a link to your post.