Crowley Code! 
 (Take 12)

Dopploadr at Yahoo! Open Hack Day 2008/09/14

My hat's off to Yahoo! for putting on a great show this weekend.  More than one person told me how much more excited they are about Yahoo! after experiencing Hack Day.  It really does bring out the best in everyone. Plus, the Girl Talk set Friday night was killer.

MikeD and I showed up proudly wearing our OpenDNS t-shirts and were taken aback by the number of excited OpenDNS users we encountered — thanks, guys.  Mike did the vast majority of the work on our main hack, a reworking of the OpenDNS Guide to use Yahoo!'s BOSS search API.  We're excited about the prospects of integrating our user's preferences directly into search results.  My part in all of this was to wrangle the markup and CSS.  We really could roll this out next week and we wanted it to look that way.  In the demo, Mike mentioned (casually) that we could throw a few million queries per day at BOSS.  We aren't kidding.

Enough OpenDNS, tell me about the cheating

Before I sat down to crank out the eye-candy for the OpenDNS Guide, I built an extension for the Flickr Uploadr.  But I wrote the Flickr Uploadr.  This is totally cheating.  I'd like to think that the Flickr judges felt the same way and that's why I didn't win any prizes but it doesn't matter because some people I really admire graciously complimented my work and I expect it will see quite a bit of day-to-day use.  I hope it can also serve as a good starting point for future extensions.  Without further ado:

Dopploadr

Dopploadr is an extension for the open-source, Mozilla-based Flickr Uploadr.  As I said in the demo, it works just like a Firefox extension because it is.  The Uploadr includes Mozilla's Extension Manager.

Once you install Dopploadr, Uploadr will take you to Dopplr to authenticate.  My apologies for the copy & paste step but there's no equivalent of flickr.auth.getToken in the Dopplr API. One other catch that should be mentioned is that Dopplr's API must be accessed over SSL and (at Yahoo! and during my demo, at least) their servers or certificates frequently and randomly fail.  Try again.

Once you're authenticated, there's really no UI to it.  The status bar will indicate you're signed in, saying "Dopploadr for rcrowley" or some such but the real magic happens behind the scenes.  Each time Uploadr thumbnails a photo, it hands off the date-taken field during the after_thumb event and Dopploadr decides where you were at that time, noting the latitude/longitude and some tags like:

When you upload a batch, Uploadr will again be really secretive but Just Work.  The before_one_upload event will combine the user's tags with the geo tags above and then let Uploadr continue with the upload.  When Uploadr finishes, it hands off the photo's ID to Dopploadr during the after_one_upload event so Dopploadr can call flickr.photos.geo.setLocation with the stored latitude/longitude.

My official monkeypatch count sits at 3.  First was adding the after_logout event that I still haven't actually used (see also version 0.2).  Second was a short walk around the DOM to insert Dopploadr's string bundle (strings accessible from JavaScript).  Third was adding a counter for outstanding Dopplr API calls and making the buttons.upload.enable() method sensitive to the count to prevent uploading before everything's been geotagged.

Here's the photo I uploaded during my demo: http://flickr.com/photos/rcrowley/2853699765/. (See, it really works!)

You can download Dopploadr 0.1 or check out the code on GitHub.

My sincerest thanks once more to the folks all over Yahoo! that made Hack Day happen.

Comments (9)

  1. Glad you had a good time :D

    Mike P — 2008/09/14 3:46 pm

  2. I'm really excited to hear that OpenDNS will be using Yahoo! BOSS.  I think that will present some interesting opportunities and show the power of using BOSS in a corporate environment.  I wish I had thought of that idea.

    David Hall — 2008/09/15 4:14 am

  3. Thanks for coming.  I'm glad you had fun! Cheers, -c

    Cody Simms — 2008/09/15 5:43 am

  4. Dopploadr was a really smart hack. Good work!

    Also, the OpenDNS hack was quite nice, too. Love your guys' service. Keep up the great work.

    That Kid from Omaha — 2008/09/15 9:31 am

  5. Since you know all of the Flickr staff, the prizes might not have been that useful to you :)

    But *awesome* hack, none the less. I'm really glad at least a few people realized how cool machine tags are.

    Ross — 2008/09/15 5:27 pm

  6. On Uploadr 3.1 (a special video build I got from the Flickr forums), the statusbar says 'Dopploadr ready for (null) (1)'. There is only one suspicious error in the console:

    Error: l is null Source File: chrome://dopploadr/content/overlay.js Line: 58

    Brian King — 2008/09/16 9:09 am

  7. @Brian: That issue should be fixed in the master branch and the new 0.1.1 build.  Thanks for pointing it out.  Shoddy error checking on my part.

    Richard Crowley — 2008/09/16 8:48 pm

  8. Nice hack. I've been working on something that sort of does the same thing, but with images already on Flickr.

    This does lead me to a slight issue- some of photos I'm tagging already have location data. Obviously I don't want to overwrite that, so I won't, but I am considering using a dopplr:woeid= machine tag (to make it clear that's where the trip was), so that the user can keep (or add their own) woe:id= tag later. Would you be open to doing the same?

    Paul Mison — 2008/09/21 4:18 am

  9. Until recently we were suffering from http://davidsmalley.com/2008/6/22/firefox-3-triggers-an-openssl-bug - an openSSL interaction bug with firefox 3, and I know it was causing API problems. Let me know if you're still seeing issues.

    Great tool, by the way.

    Tom Insam — 2008/09/29 4:06 am

Richard Crowley?  Kentuckian engineer who cooks and eats in between bicycling and beering.

I blog mostly about programming and databases.  Browse by month or tag.

To blame for...


© 2009 Richard Crowley.  Managed by Bashpress.