Sample OpenID application updated for latest Rails and OpenID gem

27 May 2008

Some of my more popular blog posts are the ones detailing my work on modifying the acts_as_authenticated plugin to work with the open_id_authentication plugin, giving you both OpenID and username/password logins in your Rails application — here, here and here. After a few inquiries, I have now updated my sample OpenID application to work with the latest Rails (2.x), the latest ruby-openid gem (2.0.4), and the restful_authentication plugin, and I’ve made it a free download at Rails Kits.

I’ve taken these two fantastic plugins, made some nips and tucks to get them working well together, and put it up for download at the OpenID Rails Kit page.

Getting started with OpenID on Rails is as simple as downloading the Kit, installing the ruby-openid gem, and loading the included schema. It even supports Yahoo’s implementation of specifying a different identity URL than the one the user supplies when creating an account (part of the OpenID 2.0 spec), as discussed here.

Enjoy!



Taking snapshots of web pages with Ruby

22 May 2008

Last summer I had a client project that involved customers using a web application to create web sites that were themed (think hosted CMS or hosted blog), and the client wanted to provide screenshots of how the hosted site would look before the customer purchased the site and actually got access. My solution was to create a ScreenShot model that belonged to the Site model, and the screenshot images were stored via the ScreenShot model.

The fun part was that the client wanted the best-looking shots, so that meant using webkit on OSX, and the OSX box wouldn’t be in the same datacenter as the servers running the web application. I ended up using Drb to send the screenshot requests to the shooter, which then used Net::HTTP to upload them back to the web application. :) It was a fun project.

I was reminded of all this when Tobi recently blogged about doing something very similar. Though my code for taking screenshots doesn’t meet his requirement for it to run on Linux, I thought I’d share my code anyway for others who don’t have that requirement.

As usual, I’m standing on the shoulders of giants here, as most of the heavy-lifting was done by others — specifically, here and here. I just wrapped their code up in a handy little class I called Snapper. Enjoy!



1 tip to make your customers love you

1 May 2008

I used to love the company Overnight Prints. They offer a great product at reasonable prices and with reasonable service. Until this week, I had no reservation about referring them to anyone who needed some printing done, and I saw no need to even shop around for any printing job I needed. But that changed this week, and for only one reason: they didn’t do what was best for me, their customer.

Here’s the story. On Sunday I learned of an event happening on Friday where I could promote Catch the Best to a group of people who would be interested in the service, and so I thought of getting a batch of business cards custom-made to hand out at this event. I checked their FAQ to find the turnaround times, and saw that if I had my order in by Monday, I could get 2nd day air shipping to have the cards in-hand by Thursday. So, I whipped up a design on Monday morning, got the order in well before the cutoff time, and looked forward to the event.

On Tuesday morning I got one of Overnight Print’s periodic special offer emails. One of the offers in the email was for a free set of business cards — just the thing I had ordered the day before. I emailed customer service to see if I could get that offer, seeing as how I had placed that order under 24 hours before they sent out that offer. I got no response.

On Wednesday I checked the order status to find that the processing had been delayed, preventing the order from getting to the shipper until Wednesday, rather than Tuesday, making the estimated shipping arrival day Friday. So, the cards would arrive too late for the event, squandering the promotional opportunity.

On Thursday I contacted Overnight Prints to see what they could do regarding a refund, since their processing delay made my order a waste. They offered a 10% discount on a future order. What?! I may never order from them again because of this, and they want to give me a discount on a future order? After a bit of venting on my part, I got the original order cost (but not the shipping cost) refunded, and a discount on a future order. Great, but I still won’t have those cards for that event, will I?

So, what’s the 1 tip to make your customers love you? Do what’s best for them! If they would have simply noticed the delay in processing, upgraded my shipping to next day air for free to make sure I got my cards when I expected to get them, and sent me an email telling me that, I’d love them right now. I’d be blogging about how great they are, and raving about them to anyone who needed printing. Instead, I’m blogging about how I’m still not satisfied with the outcome I got, and how I’ll shop around the next time I need printing, and how if I recommend them to anyone again, I’ll be sure to include the caveat about not trusting them to deliver when they say they will deliver.