0xDECAFBAD

It's all spinning wheels and self-doubt until the first pot of coffee.

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.

Archived Comments

  • Les, you may want to let R/RW know about your new command.

    http://www.readwriteweb.com/archives/the_ultimate_list_of_custom_ubiquity_verbs.php

  • I disagree... Your command doesn't fit on that list. It's way too good for that list. :)

  • Well, i was having problems understanding the "tagged" and "entitled". Didn't knew it was without brackets....

    But i gotta say, it actually replaces the delicious firefox extension for its easy way of posting links on delicious.

    Well done, and seeing that it's only the begining i don't doubt that it will improve much more!

    Oh, and i had a WTF when i first saw that delicous icon on the status bar of Firefox. Didn't knew it was from your command ;)

    Thanks for making this.

  • One question: Is there a chance to remove the quotation marks (i meant the same on the above comment as well, not brackets) when saving a note about a bookmark?

    Everytime i bookmark a page via this command, it quotes the note.

  • @Jeton: I guess the quoted thing is something I do by habit, to discriminate between what's my comment and what's summary straight from the page. One way you can force it unquoted is with the "noted" modifier. So, select some text on the page, and you can do something like:

    sha noted this tagged foo bar baz
    

    That should use the selected text without quotes. Also, you can just type arbitrary stuff:

    sha noted These are notes entitled A title goes here tagged foo bar baz
    
  • @Jeton: Actually, I just made a check-in that flips it around. There's now a "quoted" modifier to wrap the notes in quotes, leaving it unquoted otherwise. I might be the weirdo here in my quote usage :)

  • I'm a weirdo too, and now I can't quite work out how to get quotes around stuff I'm quoting from a page. I assumed this would work:

    sha this quoted

    but it just adds the word 'quoted' to the end of the quoted text, without quotes.

    Similarly:

    sha quoted this tagged test

    adds the words 'tagged' and 'test' to the end of the quoted text, though this time everything _is_ in quotes. (So it seems I can get quotes, but lose the ability to tag in the process.)

    sha this quoted text

    puts the word 'text' in quotes, but drops the selected text...

    So, I give up - what's the secret to getting quotes around quoted text?!

  • And of course I worked it out immediately after leaving that comment:

    sha tagged test monkey whatever quoted this

    works just fine (but feels the wrong way around to be tagging before quoting). And now I can't work out how to quote and note, so to speak. I tried adding

    noted These are my comments on what I just quoted

    but it doesn't work, it puts 'noted These are my &c.' inside the quotes...

    (I should say, despite all this moaning, I really have been enjoying using the command - it's very slick compared to the official add-on.)

  • Huh, weird - that's exactly how I use the command:

    sha quoted this tagged foo bar baz
    

    One major difference, though, is that I'm using a bleeding edge checkout of the Ubiquity extension. I wonder if there's a bug in the parser for the last release. :(

    The definition of the modifiers is pretty simple, so there's not a whole lot of debugging I can do in the command itself. Ugh.

    Oh, and also: RIght now it's either plain notes or quoted notes. Presence of the quoted modifier clobbers plain notes. But, how that I think about it I wonder if I should make those work together.

  • Hello,

    I was wondering if there was any chance you could put together a post annotating/explaining the changes/additions to your improved Delicious command. In particular, some explanations of the code dealing with the statusbar would be helpful for us beginners. Thanks.

    Frank

  • Not a big fan of things adding stuff my status bar. :/ Ubiquity commands should just focus on Ubiquity, not XUL changes in Firefox.

  • @Tony: Actually, commands are just one of the goals of Ubiquity. Easier XUL hacking, ala Greasemonkey, is another goal, albeit under-explored so far.

  • Here is a share-to-delicious ubiquity command that automatically generates tags using YAHOO pipes. It also uses the text selected on the page as notes and the page title as the title of the article.

    http://gist.github.com/26425

  • Auto-generating tags via Yahoo Pipes is a neat trick, but it's unfortunately very much frowned upon by delicious. Not that anything negative will happen to you, but it defeats the purpose of tagging altogether.

    Try searching for "Lazy Sheep Bookmarklet" and possibly read:

    http://www.mail-archive.com/ydn-delicious@yahoogroups.com/msg00853.html

    In particular - "People add metadata so that 1) they can find things and 2) other people can find things. You are removing the step in which people add the tag metadata, thus making the system less valuable to themselves and others."

    The key word repeated there is "people"