Gravatar Problems
August 25th, 2007
When I switched the blog to Mephisto I had installed the Gravatar caching plugin. It seemed to be working fine prior to deployment, but once in production it was not working as expected. Today I finally tried to track down what was wrong. hopefully this will fix any problems with Gravatar images, creating comments, etc. I won’t be so bold as to say this will work for everyone, but it works for me :)
My first problem was that Gravatar images were not displaying at all, even when the email address had an associated Gravatar and the plugin had cached the file. I could navigate to the image directly and see it was correct, but the plugin was not finding it. After some debugging, I noticed the file exists check was using a relative path. By changing this to an absolute path I was able to see images. Woohoo!
lib/mephisto_gravatar_cache.rb (line 14)
- if File.exists?("#{GravatarAPI.cache_dir}#{md5_email}.gif")
+ if File.exists?(File.expand_path("../#{GravatarAPI.cache_dir}#{md5_email}.gif"))
Next up was an annoying error message that was appearing whenever someone posted a comment. It looked something like this:
Cache Gravatar for => somebody@gmail.com => gravatar NOT FOUND at www.gravatar.com Content-Type: text/html; charset=utf-8 Status: 302 Found Location: http://millarian.com/2007/8/22/striving-for-100-percent/comments/121#comment-121 X-Runtime: 8.55324 Cache-Control: no-cache Content-Length: 146 <html><body>You are being <a href="http://millarian.com/2007/8/22/striving-for-100-percent/comments/121#comment-121">redirected</a>.</body></html>
Same thing happened even when a Gravatar image was found… Nobody was safe from this problem. I did a search in the source for where “gravatar NOT FOUND” was being output. This message was being logged and put to the console, so I simply wrapped it in a conditional to output the results only in development mode, like so:
lib/gravatar_api.rb
def self.explain(msg)
# create a new logger if it doesnt already exist
+ if ENV['RAILS_ENV'] == 'development'
log.info(msg)
puts(msg)
+ end
end
This seemed to solve that problem.
While I was exploring the Gravatar cache plugin I also rewrote the cache_gravatars rake task to be a little more efficient and, since I exclude the explain for production, to output a listing of what’s happening.
tasks/mephisto_gravatar_cache_tasks.rake
desc "WGET all gravatars for all email addresses in contents table (comments). Call with RAILS_ENV=production (else defaults to development env)"
task :cache_gravatars => :environment do |t|
# get all the comments that have an email address
ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
- comments = (Comment.find :all).collect {|c| c if c.author_email?}.compact
+ comments = Comment.find(:all, :select => "author_email", :conditions => "author_email IS NOT NULL AND author_email != ''", :group => "author_email")
+ puts "Caching Gravatars for:"
# try caching a gravatar for each comment
comments.each do |comment|
+ puts " - #{comment.author_email}"
GravatarAPI.cache_gravatar comment.author_email
# be nice to gravatar.com, wait a second before next request
sleep(1)
end
end
Please let me know of any other oddities using the information in about. Thanks!
Server Failure
June 27th, 2007
Yep, my home server’s hard drive crashed about a week ago. As you can see, the site is back up and in tip-top condition. In fact, it may be even better than it was previously. Well, that’s not really hard to imagine is it?
I have moved to a hosted solution through Hosting Rails. So far, they have been awesome (and cheap). If you’re interested in trying them out, they gave me an affiliates link for referrals.
I have also switched over from Wordpress to Mephisto. I had wanted to try it out and this seemed like the perfect opportunity to jump right in. So far I am enjoying playing with Mephisto. Because it’s a Ruby on Rails application, I feel pretty comfortable digging into the source code. I think I have everything back the way I want it, but I welcome any suggestions for improvement.
Let me tell you, when that hard drive crashed (click, click, click… grrrrinnd) I was not all that concerned because I do fairly regular backups. If you haven’t backed up recently, I suggest you take the time right now to do so. I only lost a few posts and I was able to get those back from Google cache (Thanks Google!). The few pieces of data I was unable to retrieve were a couple of recent comments, so if you left a comment recently, then feel free to enter it again! If you haven’t left a comment recently, then now is the time to start.
The case against nofollow
February 14th, 2007
I just read an article by Loren Baker called 13 Reasons Why NoFollow Tags Suck. I don’t know much about it, but the theory is that search engines will look for nofollow on a link and not count it as a valid link to content. Thus spammers do not get any search engine benefit from leaving stupid comments. I also know Wordpress has nofollow enabled by default for comments.
While I am completely open to the possibility that nofollow is not working as intended, the reasons given in the article lack substance. I’m also a little disappointed that Robert Scoble is waffling on his support of nofollow. Below, I outline my thoughts on the 13 reasons given in Loren’s article.
- NoFollow = NoWorky – The basic premise here is that other things are more effective, like Akismet, for blocking spam. But from what I understand nofollow isn’t about blocking spam, it is about preventing spamdexing, a technique used to increase a sites ranking in search engines. With the nofollow approach, if a link gets through then it is tagged with nofollow. This point also claims that nofollow “does nothing to discourage comment spammers” but offers no evidence.
- Bloggers should moderate comments – A lot of people do this, including me, but I for one do not follow every link that people post in a comment, including their own website link. Additionally, this is one of the reasons that Wikipedia took the approach of nofollow, i.e., there is too much content being generated to have a “human inspection” on everything posted. Again, nofollow is for stuff that gets through.
- Wordpress has nofollow by default – and therefore nofollow sucks? Sounds like a complaint against Wordpress to me.
- NoFollow = NoValue – This one poses a hypothetical question and uses the hypothetical answer as an argument against nofollow.
What if they made the Yahoo! directory nofollow? Would anyone continue to purchase listings? Obviously the value of that directory would be zero of nofollow tags were applied to the listings.
Obviously! Isn’t the Yahoo! directory something you apply for? Something that goes through the “human inspection” suggested in #2? I don’t see how this has any relation to a user-driven site like Wikipedia. Remember that moderators on Wikipedia are volunteers, unlike the Yahoo!s that accept or reject directory applications. You have mountains of data added to Wikipedia everyday and the volunteers cannot keep up with it.
- NoFollow = NoTrust – If you link to someone and add nofollow, yes it is certainly a sign that you don’t want to give them an incoming link to boost their ranking. This is a personal choice. However, a commenter adding a link for their own gratification has nothing to do with me linking to them. Since I don’t know what they are linking to it is safer to add the nofollow.
- NoFollow sucks because of lack of standards – Finally a good point. I agree, if this is to be used effectively, then it must have a consistent approach that can be followed by individuals and software (e.g., Wordpress) alike. But just because you have a standard approach doesn’t mean people will follow it. There are tons of standards that people already ignore, so why not throw another on the pile – standards like this cannot be enforced.
- NoFollow is the result of search engine failures – Funny, I thought it was a result of spammers. It’s a proposed solution (or at least a stopgap measure) to get more accurate page ranking because of a natural inclination to game the system. Everybody, except spammers, benefits from more accurate page rankings because that is what determines your search result relevancy.
Search engines should be able to develop a method of identifying and devaluing links to spam sites which were placed in blog comments. Why should everyone who posts in blog comments suffer from the actions of a greedy few spammers.
There are so many things wrong with this statement that I don’t know where to begin. First, there are a lot of things that people, companies, software, etc. should be able to do, but they don’t. This is akin to saying the staff at Wikipedia should be able to document all human knowledge on a wiki. While they could try, I doubt they could keep up. This is where we come in – the crowd. Why not use our wisdom to help out? Brilliant idea! The same logic applies here. Search engines need our help to make things better. If/when they/you come up with a better idea then we can all remove nofollow and have a good laugh about it. Trying to downplay the seriousness of the spam issue by talking about “the actions of a greedy few spammers” is laughable. Looking at Akismet right now shows a report stating 94% of comments filtered are spam. The greedy few indeed!
- Comments = Relevant content – Comments don’t necessarily add relevancy.
- The wiki concept is to blame – Again, I thought spammers were to blame. Let’s see, how could Wikipedia prevent spammers from adding content… aha! Remove the ‘Edit’ link of course. Doh, it’s so easy, why didn’t they think of this before?!?
- Ads + nofollow = NoSense – This might be a whole other topic: Are ads relevant content? I have no answer at this time.
- Matt says it’s bad – That’s not really what he said. He said he was glad they tried it even though it didn’t work out like they hoped. This is not necessarily a failure of the idea, but of the implementation/uptake of the idea. He also states that “comment and trackback spam is 100 times worse now” (without a citation for the 100x). If you believe that, then does it imply that spam blocking tools like Akismet are also failing? I don’t think so. Why is there more spam? I can come up with two possible reasons off the top of my head. More people online means more spammers generating spam. Also, spammers need to spam in volume to make up for what they are losing because of tools like Akismet, SpamKarma, and, yes, maybe even nofollow links. Whereas before spammers could get 9 out of 10 spam comments through, they can only get 1 in 10 or less because of advances in spam blocking/filtering. And even the spam that gets through might not benefit them because of the nofollow link. Just a theory; I have no data to back any of that up.
- Search engine implementations are inconsistent – This tends to happen when something new is proposed. Look at CSS as an example – browsers still don’t implement it consistently. This is not a failure of nofollow, but of the companies that said they would honor the principle.
- NoFollow Sucks. Check It! – He couldn’t think of a 13th point…
It seems to me that there should not be an all or nothing approach to this issue. Why not retain unadulterated links in comments from trusted sources (e.g, whitelists)? When you prove to me that you are a worthy contributor to my content and I feel comfortable giving you a nod for that, then I will remove the nofollow by adding you as a trusted source. I would expect the same treatment for comments I place on other people’s blogs.
What are your thoughts?
Blogroll Cleaning
February 1st, 2007
I recently wrote about the problem I was having with my blogroll – it is getting too hard to keep up, especially after a 2 month absence. I have whittled the number of unread posts down by a few hundred posts, but more importantly I have axed fourteen blog subscriptions. It was almost relieving to see my total subscriptions number fall below 60. I am currently two over what I had planned on removing, but I can see myself removing more. It’s like a free-for-all… and you could be next!
Internet Explorer 7 Tests
October 20th, 2006
Ross from Zimbra has an interesting post comparing tests he performed on IE6 vs. IE7, the latest offering from Microsoft. His results are encouraging for Microsoft, but he also says that IE7 is still behind Firefox 1.5. He has not yet tested against Firefox 2.0, but I’m sure it is only a matter of time before he does.
Millarian.com is best viewed in Firefox :)
Subscriptions updated
October 13th, 2006
A small change, but one that could be significant in the long run. All subscriptions (RSS, Atom, etc.) now go through Feedburner. This allows me to keep track of subscribers and associated statistics on traffic. It looks like a great service and I have seen many other blogs using it.
Read/Write Web has an interesting post about RSS.
So subscribe already!
Tidying up
October 11th, 2006
I’ve spent a little time cleaning up the blog as well as adding plugins and widgets. I think it is pretty clean—the look I was going for. Please let me know what you think.
Also, if you are interested, here is a list of some of the plugins and widgets I have used:
- Comment Live Preview: plugin that allows you to see your comment as you type it, including processing HTML tags (by Iacovos Constantinou)
- Image Counter: plugin to display a counter as image (by Vanguard)
- Spelling Checker: checks the spelling of my posts and allows you to check your comment spelling (by Brian "ColdForged" Dupuis)
- Social Bookmarks: displays XHTML compliant graphic links to popular social bookmarking sites (by Apostolos Dountsis)
- Subscribe Me: displays subscription buttons for RSS and popular aggregators (by Denis de Bernardy)
- WP Contact Form: displays the contact form on my contact me page
- WP License: displays the Creative Commons license at the bottom of the page (by Nathan R. Yergler)
- Widgets: allows me to add widgets to my sidebar (by Automattic, Inc.)
Of course, not all of these installations went smoothly. Many of the plugins and widgets that I have installed and activated needed to be massaged to work on this site. It gave me a chance to brush up on my PHP, JavaScript, and CSS skills.
Update: The e-mail icon on the sidebar is from FamFamFam’s Silk Icons set.
Update: A few more entries into the category of useful plugins:- Feedburner Feed Replacement: forwards your feed traffic to Feedburner (by Steve Smith)
- Google Sitemaps: generates a Google sitemap and submits it to Google (by Arne Brachhold)
- WP-Cache: very fast WordPress caching plugin (by Ricardo Galli Granada)
Update: I have switched blog engines from Wordpress to Mephisto. The entries above are only valid for Wordpress. Maybe someday I’ll compile a list of the plugins I use for Mephisto…