monkinetic weblog | redmonk.net

Since 1999, IX Ed.

Archive for December, 2006

Must have been the candy canes…

Tuesday, December 26th, 2006

Last night I dreamed that I got hired by The Unofficial Apple Weblog. Only they were based in Altensteig, Germany (where I worked for several years). Riiiiiight.

VoteBack

Thursday, December 21st, 2006

I’ve been hacking on a Wordpress implementation of VoteLinks - one that actually discovers if the incoming link contains a vote in the form of a rev attribute with one of the vote-link values: vote-for vote-abstain or vote-against.

My implementation is currently based on modifications of pingback_ping(), and wp-trackback.php, and a custom plugin called VoteBack. VoteBack uses can discover if an incoming pingback came from a link containing a VoteLink, and it recognizes incoming Trackbacks with a votelink=vote-* key=value pair.

Update (01/02/2007)

Based on feedback on the trac issue, I’ve changed the plugin to not use the custom trackback_extend_comment hook, instead checking $_POST for the info right in preprocess_comment. Included is the modified xmlrpc.php that patches pingback_ping you’ll need to grab the extra data from the pingback.

Also, hopefully the pingback link data will be added to $commentdata so that pingback_extend_comment will go away as well.

Technical Details

To make this less hack-dependent, several new hooks will need to be added to WordPress. I’ve implemented the plugin as a filter on a new hook, ‘pingback_link’.

$extended_data = apply_filters('pingback_link', array($link_anchor, array()));

The VoteBack plugin parses the link anchor (the complete anchor tag for the pingback-discovered incoming link) for the vote and if found, it adds a ‘votelink’=>’thevote’ pair to the array that was passed in, then returns it. Afterwards, $extended_data is merged with $commentdata and is then passed to wp_new_comment().

Within wp_new_comment(), WordPress applies the ‘preprocess_comment’ filter, so VoteBack adds a filter on ‘preprocess_comment’ and if the comment data contains a ‘comment_vote’ key it modifies the title of the comment (really the author’s name right now) and adds ” (Agreeing)” or “( Disagreeing)”. Rudimentary, but functional.

For a demo see the first comment on: Votelinks+Trackback=VoteBack?

What’s needed

As far as I can tell, two entry points are needed: one for plugins to access trackback info (including any exteneded values that have been sent) before it’s posted as a comment, and one for plugins to process the pingback link and modify the commentdata based on what they find.

These are rough ideas and I hope that some will look at them and provide suggestions for improvements. I’m not going to release the code quite yet, but you can link to any post on this site now and if you include a vote-link, your agreement or disagreement will be noted in the posted comment.

Try It Out

Further reading:

VoteLinks + Trackback: VoteBack?

Wednesday, December 20th, 2006

I learned about VoteLinks from Jeremy Keith’s post on 24Ways, and posted yesterday about some css+javascript VoteLink UI experiments.

Well, I got to thinking about it, and while having the votelink on this site (or any other) is nice, how can the linked site be notified about the intention of the incoming link?

Well, most blog engines are supporting Trackback now, which does allow one blog post to notify another of the link. One version of the spec (I could not determine which is the canonical version) states:

Clients MAY choose to include name=value pairs in addition to those described above. Servers SHOULD ignore any such properties that it does not understand.

If this is the case, then it should be easy to extend a trackback with a new name=value pair: votelink=<value>. The receiving site could then capture the intention of the link and can store/track/display agreement metrics on incoming links. My first thought on the receiving site UI was to divide incoming trackbacks into two columns - Agree/Disagree. Another idea from my local usability expert was a simple horizontal bar chart showing the same metrics.

I’ve started working on a wordpress implmentation of these ideas. I hacked the incoming trackback code to look for a votelink=<value> pair and append “(Agreeing)” or “(Disagreeing)” to the Author’s name field. If you want to test it, send a trackback (you may have to do it manually or hack your own implementation) to this post with an additional “&votelink=vote-for” (or “&votelink=vote-against” ;-) )

Update: I’ve currently moved my target from Trackback to Pingback, though there are advantages to both. The main advantage to Pingback is that when I post, Wordpress can be configured to ping any sites I’ve linked to in my post. Part of that process includes parsing the remote post for the link that pointed to this site, so hopefully I can hook into that functionality to check the incoming links for rel=”vote-*” attributes. Trackback does have the advantage of being an easily extensible REST-like interface though, so I’ll likely loop back around on that in the future.

Testing VoteLinks

Monday, December 18th, 2006

In a recent 24 Ways entry, Jeremy Keith described how to Boost Your Hyperlink Power through the use of the a tag’s rev attribute and the VoteLinks microformat.

I thought that was pretty neat, so I first created some VoteLinks icons, then wrote some jQuery code to look for rev=”vote-for” attributes on anchors on this page and add the vote-for icon to the link on mouseover. It’s hacky right now, but after I get some smaller icons (LazyWeb alert!) it will not look as janky…

Oh, better test vote-against too. And here’s a vote-for for a kuler API testing post to test my Vote-Via-Trackback plugin. (Hm. back to the drawing board on that one.)

P.S. oh, my is it b0rk in Safari. Sorry, Mac brothers. Fixes once I can get some more time.

There are very good reasons…

Friday, December 8th, 2006

for me to stop drinking soda RIGHT NOW.

coke.jpg

Wishlist

Thursday, December 7th, 2006

With Christmas coming up, I remembered that I had a rusty old wishlist over on Amazon. So today I pulled it out, scraped off the crud, gave it a polish and some upgrades. If you’re a friend, family, or a kind stranger and want some ideas, check it out:

My Amazon.com Wish List

Damn You, Batman

Thursday, December 7th, 2006

There’s a hysterical Q&A with Sylvester Stallone on on AICN . Here’s a great one:

Q: How do you think the template for cinematic heroes has evolved from that of the action stars of the eighties? Where do you see it evolving in the future?

A: I believe the culprit in the transformation of action films can be traced to BATMAN starring Michael Keaton. By that I mean, when an individual can step into a latex suit bulging with muscles and Velcro himself into an action star body we knew the times they were a-changing. It’s tough enough to go to the gym and stay in good shape, but when you have the option to step into a Herculean Halloween costume; working out doesn’t look like much fun. Damn you, Batman.