| Facebook Integration at Backcountry.com (cont'd) |
| Websites |
| Thursday, 10 June 2010 15:59 |
|
On my last post I talked about a one day project I worked on at Backcountry.com to integrate our community with Facebook and Twitter. It turns out everyone was pretty stoked about the idea. The general thought was that it was crazy that we weren't already doing this. Enough interest was generated to kick start an out-of-cycle project to clean up the implementation a bit and launch it. As of this morning at 6 am, you can use this feature on Backcountry.com. Here's how it works. On your profile page, you can authenticate with Facebook by clicking a button that says "Connect to Facebook". When you return from authenticating, you are presented with a dialog that allows you to choose what you want to post to Facebook. Your options are reviews, photos and videos. We'll probably add more in the near future. After doing this, any time you write a review or post a photo or video (depending on the options you selected), your content will show up on your Facebook profile. You might notice that Twitter integration is missing even though it was included in the prototype. We decided to focus on Facebook only for the initial launch for two reasons: 1) Net::Twitter required us to upgrade Moose, which was a reasonable task for me to complete in my development environment, but to upgrade all of our production servers is a larger task, mostly because of regression testing. 2) Facebook will likely have a larger impact and we'd like to keep things very simple for the first launch. As I said in my last post, Facebook was pretty slick to integrate with and I didn't even use some of their super convenient libs/APIs such as FBML. Basically there is a very simple RESTful-ish service called the Facebook graph that you do very simple GET/POST/etc requests to. You can learn everything you want about the API at http://developers.facebook.com/docs/api. One thing that I couldn't find was a way to verify that your access token is still valid. The access token is what you get back from the OAuth authentication process and you need it for any subsequent calls to the graph API. So, in order to check this, we attempt to retrieve the user's profile data. There are two problems with this. First, it would be nice to have a more lightweight no-op call since I don't actually need to fetch any data. Second and more important is that I can't check what permissions the current access token grants me. For example, we need access to post to a user's wall. In Facebook, the user can revoke individual permissions such as this without disabling the entire app. So, when I retrieve the user's profile data to check that the token is valid, I don't actually know for sure that the token will still allow me to post to the user's wall. The only way I know of to check that is to try to post something to their wall, which obviously isn't an option. I don't expect that either of these problems will actually occur very often so I'm not too stressed about it. It is debatable if working on a project like this out of cycle is the best thing to do. Perhaps there were other more important things to work on instead. However, this project proved that Backcountry.com is still agile enough to whip out a project, including testing and deployment, in a few days. This is great for the company's overall success. It's also great for developer satisfaction since fast moving projects are much more fun than slow moving projects caught up in company politics. +1 for Backcountry.com. |