Favatars
Here’s a script I wrote yesterday for my site. It allows you to associate favicon.ico files (those tiny little pictures that show up next to the site address in your browser) with comments. So if my friend has a favicon.ico file in place on his site and he leaves a comment on my site his little picture will show up next to his comment.
I’ve been thinking for some time about implementing a distributed version of Gravatars that relies on these favicon files rather than a central server. Yesterday I found some php classes, and wrote some code to implement it on my site. Today as I sat down to write up a description and post my code and I found the concept has not only been thought of and executed before but has a clever name “favatars”.
The idea may not be original but it’s still elegant and hopefully this script will help someone.
Each time a new visitor leaves a comment on my site with a URL the script checks to see if they have a favicon.ico if they do it creates a png version of that favicon and caches it. The script will refresh this cached version once every thirty days. If they don’t have one or they didn’t leave an address it serves up a replacement “404” icon instead.
Wherever you’d like to have your favitar simply call the script from an <img> tag like so:
<img src="/ico2png/ico2png.php?loc=http://commenterssite.com" width="16" height="16">
Where http://commenterssite.com is the URL submitted by your commenter.
If you have comments, bug reports, or suggestions you can submit them as replies to this post.
Matt Slack
You know, this would be seriously awesome if combined with any sort of openid commenting system (i.e. http://plugins.movabletype.org/openid_comments/)
24 August
Friday
Samuel Mikel Bowles
http://samuel.bowles.es/
Hey Matt,
Thanks for stopping by and leaving a comment. I'm not sure exactly what you mean. How would you see this integration working? I think Favatars could be a good compliment to OpenID as they both rely on an URL but there are differences.
For example your OpenID URL doesn't necessarily have to be your personal blog URL (although it could be) and if your OpenID is hosted by a third party the favicon sitting at the root of that domain probably has nothing to do with you. This is already a small issue with the system. If, for example, someone is using a hosted blogging service like Blogger or Livejournal they wind up with the trademark B or the little blue pencil next to their name.
I don't worry about this much because my audience will be much more likely to have their own domains than in other cases.
25 August
Saturday
Mike
http://www.cnn.com
Cool solution!
It works like a charm!
One thing, i got some favicons with blue palette (like cnn.com) instead of red color. Is it depending on GD version?
Thanks again for this great script!
28 September
Friday
Samuel Mikel Bowles
http://samuel.bowles.es/
Mike, actually I don't have any idea. I'll have to take a look into that. My guess is it has something to do with alpha channels but I'll take a look at some point. If you figure it out before I do please let me know.
3 October
Wednesday
Leave Your Comment
Think Before You Post
Although I prefer to leave these comments uncensored I will remove abusive posts.
Style
You may use HTML tags for style including: a, b, i, br, p, strong, em, ul, ol, li, blockquote and pre.
Required
You will be required to submit your name, email address, and preview your comment before posting. Your email will not be published.