Improving my Delicious command for Ubiquity

After writing up my first stab at a Delicious command for Ubiquity, I planned to continue revising it based on feedback and to work on exploring more of what Ubiquity enables. I started looking into writing my own nouns for tag suggestions, as well as playing with page load and browser startup hooks. And, I also started poking at a little bit of deeper extension development, which took up most of my time today.

I’ve updated my UbiquityCommands page and checked in my latest revision of the Delicious command.

The main new feature is a status bar item reporting bookmarks for the current page:

 

As you can see above, the command now comes with a status bar panel powered by the Delicious URL info JSON feed, providing bookmarking info on every page visited. It shows a bookmark count, a tooltip with further information, and sends the user to the URL info page on Delicious when clicked. It mostly works, but it could use some looking at. This is my first time really cracking open the hood on Firefox and XUL, and so I’m feeling around in the dark.

Specifically, I’m using Ubiquity’s page load hook—but I’m also trying to augment that by tracking tab selection events, in order to keep the status bar info updated for the active tab. But then, that leads me to trying to track new windows, to attach the tab selection event handler for every newly opened window. Or I could just be barking up the wrong tree entirely. At any rate, the code is probably brain-dead dumb, so I hope someone can clue me into a better way.

The more things change…

So, in anticipation of hopefully carving out time to write more article-length entries like my last one on Ubiquity, I’ve revamped the design on this blog and updated the colophon. I’m also hoping to post more short entries as well, and get this place revived again in general. Let me know what you think about the new look!

Writing a Delicious command for Ubiquity

In my last post, I got all fluffy about how cool Ubiquity is but didn’t share any code to prove the point. As it happens, I have come up with at least one useful command that I’m starting to use habitually in posting bookmarks to Delicious. You can subscribe to my command or check out the full source—this post will serve as a dissection of the thing. Since this will be fairly lengthy, follow along after the jump.

Oh, and it’s been awhile since I posted something this in-depth around here, so feel free to let me know how this first draft works. And, bug reports and patches are of course welcome.

Read More »

Ubiquity cracks open personal mashup tinkering

When I was a wee hacker, I lived my digital life though a Commodore 64. I played games on it, did homework, talked to people far away—you know, all the stuff they showed in the pictures on the box. I also took things apart—both the machine itself and software running on it. I grew up learning that my digital environment was ultimately understandable, susceptible to tinkering, and open to being bent to my own purposes.

From the Commodore 64, I graduated eventually to terminals and text editors, opening portals mostly onto computers elsewhere via powerful UNIX command shells. And, of course, over the past decade, this has largely given way to life in a browser.

Yet, for a little while, particularly in the first few years of browsers, freedom to tinker seemed cramped. JavaScript had yet to arrive, and was a little messy when it did. There was no relatively easy addon development. And, though the portals opened by a browser were richer than those provided by terminals, the paths of navigation defined by links controlled by site owners offered less freedom of movement than UNIX commands. I could create my own pages, but I couldn’t do much to others’ pages.

But then, javascript: URLs came around, dots were connected, and bookmarklets were born. Suddenly, it was possible to customize my browsing environment with arbitrary JavaScript code having access to the current page—no matter whose page it was. And, through the various tricks of the AJAX trade, bookmarklets have only gotten more capable throughout the years.

Smart keyword shortcuts came around a little later, allowing quick access to bookmarks via simple keywords typed into the location bar. The smart part, though, came in the form of bookmarked URLs with placeholders and keywords given arguments to fill the placeholders—allowing not only quick access to bookmarked pages but also search engine forms bookmarked with late-bound fields.

Bookmarklets inherited the benefits of smart keyword shortcuts. The same placeholder in http: URLs can be inserted into the code of a javascript: URL, thus parameterizing the JavaScript code and incidentally turning the location bar into a kind of primitive command line. For example, one of my most heavily used “addresslets” is based on John Resig’s original “Super-Fast Delicious Bookmarklet”.

Another leap in prying open the browser tinkering space came in the form of Greasemonkey—an addon-powered environment created explicitly for the purpose of end-user scripting applied to others’ pages. Greasemonkey user scripts can do more than bookmarklets, and with a much better development environment to boot. And, though a user script can’t do quite as much as a proper browser addon, they’re much easier to hack on and distribute.

Now, consider one of Mozilla Labsnewest projects, named Ubiquity. This rough and experimental addon for Firefox combines and improves upon everything I’ve described so far:

  • Ubiquity is a hackable command line environment, better than bookmarklets and smart keyword shortcuts;
  • Ubiquity enables persistent customization of others’ pages, not unlike Greasemonkey;
  • Ubiquity facilitates live in-browser creation and web-based subscription to user commands and scripts;
  • Ubiquity gives access to browser chrome resources without a need for frequent restarts;

So far, most of the commands I see popping up since the 0.1 release have not accomplished much more than smart keyword shortcuts in the location bar could. But, it’s early yet, and Ubiquity is far from limited to these commands.

Once the basics have been well-explored, I expect to see more people taking a crack at the broader capabilities offered by Ubiquity. Bookmarklets and Greasemonkey can’t access browser chrome—but Ubiquity can. Ubiquity also offers a user interface that’s so much more promising than keyword shortcuts, including command previews and typed parameters with suggestions.

Ubiquity promises web-wide mashups directed by a conversational command interface. All in all, the potential of this makes me feel like my digital environment—browser and web as a whole—is getting even more intimately, personally hackable.

It’ll be very interesting to see where this project goes.

Moz08: Rockslides and Blackouts and Bears - Oh My!

Since the beginning, I’ve been a Mozilla fanboy. But, up until very recently, I’ve only shown that as a user and a verbal supporter, with a shallow understanding or participation in what’s really done in the Mozilla community. Sure, I’ve checked out source code from time to time going back to the first code release, built and poked at it, but I’ve never really contributed back.

But now, I’m an employee of the Mozilla Corporation, and I feel like I found a little-known cheat code for getting into the place where all the cool stuff happens. See, I just got back from this thing called the Mozilla 2008 Firefox Plus Summit—and if I was overwhelmed by the initial Mozilla Firehose after coming on-board, I’m entirely gobsmacked now.

The event—having taken place in the bear-infested, rockslide-prone, electricity-deficient wilds of Whistler, BC in Canada—was attended by not only employees of the corporation itself, but a selection of invitees from around the Mozilla community. Throughout the course of the event, I felt humbled by the efforts of everyone and have come away with a feeling that I really need to step up my game. Somehow, it seems I managed to sneak into the place without having first run the decade-old traditional gauntlet of meritocracy and contribution.

Being a newbie of just a few months, I barely know anyone at Mozilla, so I was quite overwhelmed socially. That the early-morning power loss also knocked out my CPAP and left me sick and surly on the last day didn’t help my already introverted tendencies. Nonetheless, I talked to a lot of people, attended a lot of sessions, partied a bit, played some Rock Band, and have a lot that’s percolating in my brain-meats.

There’s plenty coming up to work on in my own assigned sphere of webdev—but I’m also pretty jazzed about the Mozilla Labs projects Prism, Ubiquity, and Weave. Not sure what I can do yet, but would like to do something to help out those efforts. And maybe by the time of the next summit, I’ll still be in the Mozilla sphere and will have met and helped a few more Mozillans with whom I can connect face-to-face.

There was also a lot of talk about the future and continuing mission of Mozilla, all very inspirational and telling me that this is the center of things where I’ve always wanted to be. Now, I just have to work hard to make sure they’re not sorry they hired me! I’m running much slower than I’d like, since I feel I have a lot to catch up on while in the midst a lot of disruption and change—between the intensity of the last few months (or even the last year) and readjusting to being back in the Mitten with homeownership all anew and many plans having taken unexpected turns.

But, things are shaping up in a sort of too-good-to-be-true configuration, and I suspect I’ll be just fine if I sharpen up a bit and roll with the changes.

Delicious 2.0 is more than a pretty new face

I’m no longer at Yahoo! and I no longer work on Delicious, but I’m still a huge supporter. And, since I’m pretty sure everyone over there is either burnt out or still insanely busy at the moment, it might be awhile before anyone tells the full story of what this relaunch offers. As it is, even I only know a bit of what all went into this effort.

So, off the top of my head, I thought I might point out just a few of the easily-missed improvements the new site offers beyond the great new love-it-or-hate-it visual redesign that seems to have occupied most of the discussion I’ve seen so far:

Search works and is incredibly fast. In fact, search may really be the real star of the redesign show here—especially since del.icio.us often took 30 seconds or more for a simple search, rendering it all but useless. Today, though, it’s at ludicrous speed in comparison—and so finally, the real power of search applied to social bookmarking might start to shine with the critical mass of content found by real people using Delicious.

To scratch my own itch, I’ve created an unofficial OpenSearch search engine plugin for Delicious on Mycroft. Though I think it comes along with the browser extensions, I’ve yet to find this for autodiscovery from the site itself.

The notes field in bookmarks has been expanded from 255 to 1000 characters. Yes, this means that you can now include long running quotes from pages, or complete paragraphs of rambling discourse.

The feeds have all been overhauled and reorganized. An attempt at backward compatibility was made, but the old feed URLs are all deprecated. Replacing these, there’s now a common and consistent URL namespace for feeds across formats.

Almost all RSS feeds have JSONP counterparts, and further feed formats could be considered. Additionally, the old mix of RSS 1.0 and 2.0 has been dropped in favor of RSS 2.0 format across the board to support podcast and media enclosure elements consistently. The linkrolls, tagrolls, network badges, and tagometers now all use the new JSONP feeds—and the widgets can be examined as example code in using the feeds.

Tag bundles can now be viewed as combined bookmark views, complete with feeds. This augments bundles from a simple visual organization tool to a more powerful content aggregation function. Personally, I never had much use for tag bundles until now, but since they can actually be used to partition tags and bookmarks I might actually take the time to use them. Check out these example URLs:

Bundles now work for tags, network contacts, and subscriptions. This means, for example, that you can partition your network contacts into topical groups. From there, you can subscribe to those partitioned bookmarks in different folders in readers, or use the bundled bookmark views in mashups through JSON feeds. Check out these example URLs:

Network member and fan feeds now include the date when the contact was added. Pro tip: Subscribe to fan feeds to see when new people have started following your bookmarks.

Several previously undocumented parts of the V1 API have now been documented. In particular, the following new parameter combinations have been used with the browser extensions for primitive bookmark sync:

  • https://api.del.icio.us/v1/posts/all?hashes
  • https://api.del.icio.us/v1/posts/all?meta=yes
  • https://api.del.icio.us/v1/posts/all?fromdt={DT}&todt={DT}
  • https://api.del.icio.us/v1/posts/all?start={##}&results={##}

The posts/all API URL works again for users with large collections. With my 11k+ bookmarks, del.icio.us was keeling over with the attempt to assemble and deliver my entire collection with a posts/all call. Now, however, Delicious 2.0 appears able to handle this call for my account.

Easter eggs have been rotated and recalibrated. No, I’m not going to tell you what or where or how many they are.

delicious 2.0 legacy bookmarklet fix

As you’ve probably seen by now, Delicious 2.0 has launched. It’s an all new design and the whole thing has been rewritten from the ground up. Most of the gripes I’ve seem like general dislike of change—which actually attests to the gargantuan effort put forth to reimplement the original from scratch in a whole new language and architecture.

That said, I found at least one little bug that stops my usual bookmarklet flow. And, what’s really annoying is that, it’s probably a bug in code I wrote at one point. As it turns out, the original URL parameters for the bookmark posting form don’t seem to be accepted anymore, so legacy bookmarklets may be broken. I swore I tested that, since I’ve got some personal investment in it.

But, although I can’t contribute code to the project anymore, I’ve at least still got Greasemonkey. And, through this quick & dirty user script, I’m back to using my legacy bookmarking bookmarklets. In case you’re interested, here’s my favorite Firefox keyword shortcut bookmarklet—just select some text, type the keyword in the URL bar with some tags, and hit return.

using Twitterrific with identi.ca

Since identi.ca has introduced support for the Twitter API, switching Twitterrific over seems to be as easy as entering this command in a Terminal window:

defaults write com.iconfactory.Twitterrific baseUrl -string 'identi.ca/api'

The command to switch back is the following:

defaults write com.iconfactory.Twitterrific baseUrl -string 'twitter.com'

You’ll also need to restart Twitterrific after each of these to see the change working.

It took me awhile to figure this out, because I didn’t realize that they’d hidden the details in plain sight. You know, like, in the README file that comes with the Twitterrific download. Sheesh. Who reads those?