this is aaronland

“Smoking wasn't dangerous then.”

Things I Like About San Francisco #1154307965

The dragon flies were out in Delores Park this afternoon.

/tag/restobook

I was going to work on the e(r)dfg-writer when I got back from Helsinki, but while I was there I filed the following under Thinking Out Loud : I'd like to be able to open the address book (on my phone) and select a contact and then use their email address to key into the Flickr database. If there's a match, do stuff like add their Flickr homepage and their most recent photos feed as URLs and store their NSID for future API goodness. If they have a buddy icon then use that for the thumbnail in the contact database. From there it's no great leap to imagine a glorified slideshow application that displays photos for Flickr contacts in your phone's address book.

Because the address book is still the center of everything.

I have been going on, for years, about how great it is that Nokia has ported Python to their phones but I've never really done anything about it. So I rolled up my sleeves and wrote everything I just described. Sort of.

The tool for merging an address book contact with their Flickr account works (except for the part on page 60 of the Series 60 Python API Reference that reads : The following field types are recognized but cannot be created at present: thumbnail_image) although the UI is awful. I will release it once it's been cleaned up a little.

update: This is almost done but then I saw a presentation on Wednesday night and got a little distracted by another neat idea which I'll write about soon. This one will be released but until you can set a contact's thumbnail image it is a largely pedantic exercise with no magic.

update: fladdressbook 0.1, will fetch and merge Flickr account data for a Series 60 address book contact.

The tool for doing a slideshow for those contacts worked, mostly, and then got dragged down by the lack of a real emulation environment for OS X, the inability to do any kind of useful debugging the moment you create a Canvas object and who knows what's really going on threading weirdness. I would still like to finish it but I'm feeling a little burned out by it now and it's hard to get excited about anything that is really just a feed aggregator. (I opted for polling feeds rather than implementing the API because that seemed easier and faster. At the time.)

But I'd managed to do enough hacking to get a feel for how things worked and I started to think about what else I could suck in to the address book. Restaurants seemed like an obvious choice and keeping restaurants listed in del.icio.us also seemed like a good idea. I suppose there are legitimate privacy concerns but to my measure they aren't a big deal and don't outweigh the benefits : Ready-access from any web browser, not having to deal with synching and just otherwise sharing with the community. For example, I spent a lot of time poking around /helsinki and /helsinki+restaurant before I left for Finland and it was very useful.

Okay, everything except for the part about ready-access. I never did get international-roaming working on my cell phone while I was overseas and looking up restaurants, on the web, would not have been emergency enough for me to suffer the GPRS rates in Europe. Why not just suck it down and store it locally? At a minimum having the phone number bolted in to the (drumroll) make a phone call functionality would make it worth it. If you've also got a phone where you can hack away at other information (hello, location data) then you can start to have even more fun.

Translation : Please god, make Yelp develop a decent mobile web site.

So, yeah, I wrote the thing to do all of that. It relies on three things :

  1. All the relevant bookmarks be tagged with restobook
  2. All the restaurant-specific metadata be stored in the bookmark's description field. Tags are still stored as tags and accounted for later.
  3. All the restaurant-specific metadata be written in a bastardized version of RDF/N3.

Here's what the metadata for Quince, a fancy-pants restaurant in San Francisco, looks like :

# Does this look strangely like the kind of thing that Norman Walsh has
# been plugging away at for years? It does, doesn't it. He's smart, like that.

:address "1701 Octavia @ Bush San Francisco CA 94109"; :phone "415 775 8500";
:yelp "zFxD8QinHt69Bs7M2mgB-Q"; :hours "M-H 17H30-22H00 / F-Su 17H00-22H00";

And this is what the application does with all of my del.icio.us links tagged with restobook :

 restobook says hello!
 ---------------------
 Reading configs
 Testing your network connection
 Testing your del. login
 Fetching dates tagged with restobook
 Fetching posts tagged with restobook on 2006-07-21
 Fetching posts tagged with restobook on 2006-07-20
 Fetching posts tagged with restobook on 2006-07-18
 Fetching posts tagged with restobook on 2006-07-17
 Parsing 6 results
 Parsing data for Quince
 Trying to geocode 1701 Octavia @ Bush San Francisco CA 94109
 Parsing data for Bar Tartine
 Trying to geocode 561 Valencia San Francisco CA 94110
 Parsing data for Bacco
 Trying to geocode 737 Diamond @ 24th San Francisco CA 94114
 Parsing data for The Blue Plate Restaurant
 Trying to geocode 3218 Mission St. @ Valencia San Francisco, Ca. 94110
 Parsing data for La Ciccia
 Trying to geocode 291 30th @ Church San Francisco CA 94131
 Parsing data for Schroeder's German Restaurant
 Trying to geocode 240 Front St San Francisco, CA 94111
 
 # At this point, the application actually starts to store
 # the restaurants in your address book. When run in debug
 # (emulation) mode on the desktop it dumps restaurant data
 # to the screen...

 Quince (dump) :
 --------------------------------
 phone_number : 415 775 8500
 city : San Francisco
 geopostion : 37.788026, -122.427107
 tags : french italian resto restobook sf tryme
 country : Us
 http://maps.yahoo.com/py/maps.py?addr=yadda+yadda+yadda (map)
 http://del.icio.us/url/cefa3614ae92b56ad332d525da9cc4e0 (del.icio.us)
 http://www.quincerestaurant.com/pages/home_main.html (homepage)
 http://www.yelp.com/biz/zFxD8QinHt69Bs7M2mgB-Q (yelp)
 hours : M-H 17H30-22H00 / F-Su 17H00-22H00
 state : Ca
 postal_code : 94109-4326
 company_name : Quince
 street_address : 1701 Octavia St
 --------------------------------
 
 # And so on
                    

Some caveats and notes along the way:

The Helsinki Diaries, Stardate : 1151915967