-
Content Publishing Protocol
- body
-
Since APP (understand here) is mainlined in WordPress, it makes sense to use it in DiSo efforts. I doubt that my OAuth plugin will work here, but it's worth testing. It may mean using headers, but with comment and discovery support we should be able to build a distributed commenting system, at least for Wordpress.
I've thought about other APIs that would be useful for DiSo. For example, adding friends or groups. APP does not fit this, but the general concepts do. Perhaps APP can be abstracted into more of a CPP.
GET on main endpoint to list items (ATOM can always be the main wrapper here).
POST to main endpoint to create new items.
PUT to node to edit.
DELETE to node to delete.
Authentication unspecified (HTTP Basic or OAuth work well).
If the content of your POST and PUT requests is ATOM, you have AtomPub. The same basics can easily work with other content. (The other content types could be encapsulated in ATOM entry bodies on the GET list, or XOXO).
For example, a POST body of XFN+hCard could add a friend. A PUT body of hCard could edit a profile (ie, to add groups).
I would also like to suggest that POST on a node could be used to add comments (create new content on a content node).
-
Avatar Plugins
- body
-
About time! I've mentioned multiple times that I wanted to turn the logic I use here for user photos on comments into a plugin. I've made two hacks for blogger that do this, after all, why not for Wordpress?
My recent work with the DiSo project has caused this interest I had to come back, in the form of two plugins.
Plugin #1 - Avatar from URL
This plugin looks at the comment author's URL and tries to find a suitable image. This is primarily done by looking for an hCard, but it will also use other images if no hCard I found.
Plugin #2 - AllAvatars
This plugin is what is now powering comment avatars on this blog. It detects if you have the gravatars plugin, the avatars from URL plugin, or the favatars plugin installed and tries to use the avatar those plugins would normally give (in the listed priority order) — thus allowing more avatars to display than with any one of these plugins.
It also detects if there is photo data in the user's profile (such as data imported by my semi-released hCard Import plugin) and overrides any other plugins with that.
-
Blogging vs. Commenting
- body
-
I've been reading Marc Andreessen's blog for some time now, and have been ever impressed by the quality and range of content he's putting out. One of his recent posts dealt with some meta-conversation about blogging. Is it better to comment or to post about something on your own blog?
He makes some great point against commenting. Comments require filtering and moderation. Comments also seem to encourage poorly written posts or small 'me too' which are not worth reading.
He also makes a rather big point about blogging. Anyone can do it. There are a number of free services (Blogger and WordPress.com among them) that let ANYONE EASILY blog.
I'm not ready to turn off comments here just yet, but I must say that this makes sense to me. If you link to me I'll find what you said. If you trackback it still shows up here on the post. I think there's a place for commenting, maybe, but it's definitely worth thinking about.
What do you think? Comments, trackbacks, or both?
-
New Comment Photo Hack (Blogger)
- body
-
By demand, I have added a maxheight option to this hack as well, it works the same way as maxwidth
Some people have really liked my comment photos and highlighting hack. Many have hated it. Especially since the move to the new Blogger, the hack is just unstable and difficult to implement or understand. Even my own implementation (before the move) was doing odd things.
So I decided that a complete rewrite was in order. The old scripts are still intact, but this new hack uses none of the old code. This hack does only comment author photos (highlighting is better handled other ways in the new Blogger).
This hack is 100% compatible with the newest version of my asynchronous peek-a-boo comments.
Without further ado, the instructions:
- Go to 'Edit HTML' under Template and check the 'Expand Widget Templates' box.
- Find the following code:
<dl id='comments-block'>
<b:loop values='data:post.comments' var='comment'>
and insert the following code directly after it:
<div style="clear:both">
<dt style="float:left;margin-right:5px;clear:both;" expr:id='"commentphoto" + data:comment.id'></dt>
<script type="text/javascript">if(typeof(commentPhotoIds) == 'undefined') var commentPhotoIds = []; commentPhotoIds.push({'id':'commentphoto<data:comment.id/>', 'url':'<data:comment.authorUrl/>'});</script>
- If you go down a very small ways from where you were in the previous step you will see a
</dl>. Directly before it insert the code:</div> - Directly before the
</body>code in your template add this code:
<script type='text/javascript'>
//<![CDATA[
function commentPhotoDo() {
var tag;
for(var i in commentPhotoIds) {
tag = document.createElement('script');
tag.type = 'text/javascript';
tag.src = 'http://scrape.singpolyma.net/avatar.php?maxwidth=70&url='+encodeURIComponent(commentPhotoIds[i].url)+'&id='+encodeURIComponent(commentPhotoIds[i].id)+'&defaultimage='+encodeURIComponent('http://img139.imageshack.us/img139/1011/defaultavatarad7.png');
document.body.appendChild(tag);
}//end for var i in commentPhotoIds
}//end function commentPhotoDo
commentPhotoDo();
//]]>
</script>
- Save your template
My fellow hackers will not like the way I did the second-to-last step. I should be using window.onload. I am not simply because in the tests I did on a certain much-hacked template, this worked and the other didn't. I am not prepared to say why the other didn't, only that it didn't and that disturbed me. So for this hack I'm doing it like this. It works.
This hack causes direct hits to my singpolyma.net hosting server every time a page loads. If your blog gets a significant amount of viewers (>300 subscribers or thereabouts) I would ask that you contact me before installing this hack so that we can work out whether it will be a bandwidth issue or not. Thank you for understanding.
-
Asynchronous Peek-a-boo Comments
- body
-
I have made some minor, optional changes that just make the code cleaner. I have removed support for my old comment photo hack from this code. I have added support for my new comment photo hack. Please re-install if you are going to use the new hack.
I have added the ability to limit the number of comments displayed (requested by kca) and fixed the Jose problem.
Many people have benefited from my peek-a-boo comments hack for the new Blogger. It has one serious downfall however. Loading all that extra data inline can be slow. This version of the hack is designed so that the comments are not loaded until after you click the link to display them. This fixes some minor issues and improves speed like no one's business.
- Go to the layout on your BETA blog and select 'Edit HTML'.
- Check the 'Expand Widget Templates' box.
- Paste the following code into the <head> section of the template:
<script type='text/javascript'>
//<![CDATA[
var comment_form_template = '<div class="commentelem" style="clear:both">\n'
+ '<div style="float:left;margin-right:5px;clear:both;" id="commentphoto[[CID]]"></div>'
+ '<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></div>\n';
//]]>
</script>
<script src='http://jscripts.ning.com/get.php?xn_auth=no&amp;id=2941927' type='text/javascript'/>
- Find the code that looks something like:
<b:includable id='comments' var='post'>
<div class='comments' id='comments'>
And replace that second line with:
<div class='comments' expr:id='"comments" + data:post.id'>
<b:if cond='data:blog.pageType != "item"'>
<script type='text/javascript'>
document.getElementById('comments<data:post.id/>').style.display = 'none';
</script>
</b:if>
- Right below this, find the code that looks like
<dl id='comments-block'>and just before it, insert<div expr:id='"commentsul" + data:post.id'> </div> - Next, find the post-generating code. It will look start something like this:
<b:includable id='main' var='top'>
<!-- posts -->
In this section there will be a block of code that looks something like:
<b:if cond='data:blog.pageType == "item"'>
<b:if cond='data:post.allowComments'>
<b:include data='post' name='comments'/>
</b:if>
</b:if>
Replace it with this:
<b:if cond='data:post.allowComments'>
<b:include data='post' name='comments'/>
</b:if>
- Find the post template section, which starts something like this:
<b:includable id='post' var='post'>
And then find the link to the comments area, which looks something like:
<b:if cond='data:post.allowComments'>
<a class='comment-link' expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'><b:if cond='data:post.numComments == 1'>1 <data:top.commentLabel/><b:else/><data:post.numComments/> <data:top.commentLabelPlural/></b:if></a>
</b:if>
And replace it with:
<b:if cond='data:blog.pageType != "item"'>
<b:if cond='data:post.allowComments'>
<b:loop values='data:post.feedLinks' var='f'>
<a class="comments" rel="comments" expr:href='data:post.url + "#comments"' expr:onclick='"peekaboo_comments_display(&quot;" + data:f.url + "&quot;,&quot;commentsul" + data:post.id + "&quot;,&quot;&quot;,&quot;" + data:post.url + "#comments&amp;quot;,&quot;max comments&quot;);toggleitem(&quot;comments" + data:post.id + "&quot;);return false;"'><b:if cond='data:post.numComments == 1'>1 <data:top.commentLabel/><b:else/><data:post.numComments/> <data:top.commentLabelPlural/></b:if></a>
</b:loop>
</b:if>
<b:else/>
<b:if cond='data:post.allowComments'>
<a class='comment-link' expr:href='data:post.url + "#comments”;' expr:onclick='"toggleitem(&quot;comments" + data:post.id + "&quot;);return false;"'><b:if cond='data:post.numComments == 1'>1 <data:top.commentLabel/><b:else/><data:post.numComments/> <data:top.commentLabelPlural/></b:if></a>
</b:if>
</b:if>
Replace the redmax commentswith the maximum number of comments to display asynchronously (or replace with false to display all comments). - Click 'Save Template' and, if it appears, 'Confirm & Save', then view your blog.
To make my comment author photos and highlighting work with this you will need to make sure you have the latest version of that hack installed.



Comment at
Post a Comment