Tag Archive - microformats

Operator 0.8a is Available

I have made an alpha of Operator 0.8 available. Special thanks to Elias Torres for the RDFa support.

My primary goal with Operator 0.8a was to attempt to finalize APIs for both Operator and Firefox 3. What I actually ended up with is very similar to the APIs I created with the very first version of Operator. You can see the microformats API for Firefox 3 here (looking for feedback). I’ll be documenting the action and microformats API more completely in the next few days.

New features in this release include:

  • RDFa support (view only – there are no actions yet)
  • Unified actions architecture – actions are no longer specific to a microformat
  • Support for Address microformat to allow some actions (like map lookups) to be more granular.
  • Better support for iframes/frames/nested documents
  • Debug mode uses X2V for hCards and hCalendars
  • Support for non HTML documents
  • Bug fixes galore.

One feature I removed that I know people will complain about is the ability to have custom names for the actions. If I get enough complaints, I’ll put this back.

IMPORTANT NOTE: This release uses new preferences so it will wipe out your old prefs. This should be the last time that happens. I also changed the location of user scripts so it won’t pick up your old ones (they won’t work anyway).

If you want new user scripts, check out: http://www.kaply.com/weblog/operator-user-scripts/

If you have user scripts you want to quickly port to Operator 0.8, please send them to me and I’ll help.

Please report bugs here.

Have fun.

Where is the next version of Operator?

You might have heard from Elias Torres that we have RDFa working in Operator. You might also be wondering where that version is.

Basically I’ve been working very hard to finalize the APIs so that I can get things ready for Firefox 3. You can take a look at them here. The ironic part is that I’ve actually gone back to the way I wrote Operator the first time in terms of how microformats and actions are added to Operator. I’ll be documenting this soon. And if you wrote to any of my other APIs, I’ll work with you to move things to the new model.

So what do you have to look forward to in Operator 0.8a?

  • RDFa support
  • Unified action architecture (actions on the toolbar aren’t specific to microformats)
  • Support for non HTML documents
  • A final architecture for actions and microformats so people can start coding to it
  • Debug mode displays X2V output
  • Export All available in “Microformats mode”
  • Lots of bug fixes

Stay tuned. Just some fine tuning and we’re good to go.

Microformats and Firefox 3 (for Developers)

So let’s talk about what Firefox 3 will hopefully offer for developers. The goal is that extension authors will have an API to access microformatted data directly without worrying about parsing. In addition, there will be a model for adding additional microformats, as well as adding semantic actions (more about that in a minute). Here’s what the API looks like right now.

Any microformat can be instantiated from a DOM Node:

var hcard = new hCard(DOMNode);

Once the microformat has been instantiated, members can be accessed directly, like hcard.fn. If the property is defined as an array in the microformat specification, it is an array in the newly created object. A pointer to the original DOM node is also stored in this object if you want to do anything to the microformat node on the glass.

Microformat objects can be queried from a document:

var hCards = Microformats.get(document, "hCard");

I need a better name for this one I think. Given a document and a microformat type, this API returns an array of objects that represent each microformat in the document. I’m not sure if this should go through all the child frames and return every microformat in every sub document. I have to think about that.

If you have DOM Nodes, you might need some information about them. The scenario here is what if you have a DOM Node and you don’t know if it is a microformat or not? What APIs could help you?

Microformats.isMicroformat(DOMNode)

This function tells you if the specific DOM Node you passed in is a microformat. It returns a boolean.

Microformats.getParentMicroformatNode(DOMNode)

This function gets the first microformat that is a parent of this node. If you pass in a microformat, it still gets the parent. This is important for finding nested microformats.

Microformats.getMicroformatNamesFromNode(DOMNode)

This function returns an array of the microformat types that this node represent.

So here's how you might use those three functions, for instance when a context menu is displayed on a given node:

  if (Microformat.isMicroformatNode(node)) {
    mfNode = node;
  } else {
    mfNode = Microformats.getParentMicroformatNode(node);
  }
  while (mfNode) {
    var mfNames = Microformats.getMicroformatNamesFromNode(mfNode);
    /* enumerate through names and do something */
    mfNode = Microformats.getParentMicroformatNode(mfNode);
  }

I mentioned semantic actions earlier. I'm still working on how I can create an action model that is easily extensible. In an earlier post, I suggested that actions be implemented like this:

semanticActions.actions.youtube_search_tags = {
  description: "Find videos on YouTube",
  icon: "http://youtube.com/favicon.ico",
  scope: {
    semantic: {
      "tag" : "tag"
    }
  },
  doAction: function(semanticObject, semanticObjectType) {
    if (semanticObject.tag) {
      return("http://youtube.com/results?search_query=" + encodeURIComponent(semanticObject.tag));
    }
  }
};

I'm now trying to decide if I should use a function method, something like:

semanticActions.addAction("youtube_search_tags", youtube_object);

There will be much more on that later.

Anyway, I'm primarily looking for feedback from people. Are these APIs sufficient? Did I miss something obvious? Thanks for the input.

Microformats and Firefox 3 (for Users)

I’m now the official owner of microformats support in Firefox 3. Here is the preliminary design document.

At this point, we’ll primarily be focusing on making microformats available to extension developers, with very little UI. The primary motivator behind this is that I don’t think anyone has come up with a good user interface for microformats. I want to take some time to bring up some different UI paradigms and have some general discussion on these ideas just to see what people think. We’re actually trying to have a UI discussion on the labs forums, but we’re not getting much input so I thought I would try here.

So far there have been multiple extensions with multiple ways to interact with microformats:

  • Operator (toolbar, status bar button, toolbar button, right click on microformats)
  • WebCards (in page “cards” – notifcation ribbon on the bottom of the screen, right click on microformats)
  • Tails Export (sidebar)
  • Tails (icon on the status bar – window presenting content of the microformats)

Some of the other ideas that have been floated have been using the Firefox notification bar to inform about microformats, in page highlighting of microformats, notifications on the URL bar similar to RSS feeds and changing the mouse pointer. You can see some of these ideas at Alex Faaborg’s blog.

The primary concern we have in creating a microformats UI is that it’s not necessarily something that is going to be accessed a lot (like a back button for instance, or bookmarks), so how much screen real estate should it take?

With Operator, my original plan was to allow for many different UI paradigms, and I’m continuing that in the next release by allowing individual buttons for specific microformats (a Contacts toolbar button for instance). So now I’m putting the question to you:

What UI paradigm for microformats do you prefer? Is there a paradigm you wish was in Operator (like a sidebar for instance)? What do you think microformats should look like in Firefox 3?

Feel free to come up with any wild idea you want.

In my next post, I’ll be talking about what we should do for developers.

Operator Action Architecture

One of the things I’ve been trying to finalize for the next release of Operator is the action architecture. Here’s what things look like now.


ufJSActions.actions.corkd_search_tags = {
  description: "Find wines on Cork'd",
  icon: "http://corkd.com/favicon.ico",
  scope: {
    semantic: {
      "tag" : "tag"
    },
    url: "http://corkd.com"
  },
  /*
   * Perform an action
   *
   * @param semanticObject JavaScript representation of the semantic object
   * @param semanticObjectType Semantic object type as a string
   * @param domNode DOM Node associated with the semantic object
   * @return If you return a value, we attempt to open it as a url
   */
  doAction: function(semanticObject, semanticObjectType, domNode) {
    if (semanticObjectType == "tag") {
      if (semanticObject.tag) {
        return("http://corkd.com/tags/" + encodeURIComponent(semanticObject.tag));
      }
    }
  }
};

First let’s talk about scope. Semantic scope is about indicating which microformats (and in the future other semantic data) this actions works with. On the left is the type of semantic data, on the right is the required value. So for instance, if you had an action that worked on hCalendar and required a dtstart, it would be “hCalendar” : “dtstart”. You can use url to specify that an action should only be displayed when you are on a certain web page.

Next, let’s talk about the action itself. When you return a value from an action, we assume it is a URL and open it. If you want to do your own thing (like export a vCard), you can do arbitrary JavaScript and just return. I’m also working on a “doActionAll” which will allow on action to act on all microformats of a given type on a web page.

What do people think of this overall design? Is it simple enough to encourage anyone to write actions? Am I missing anything obvious?

Operator 0.7 is available

Operator 0.7 is on addons.mozilla.org. I have a few things I wanted to share about this release. New features will be at the end of this post.

I’m not sure people realize there are other ways to interact with Operator besides the toolbar. Not only can you have Operator on the status bar or as a toolbar button, but you can right click on a microformat on a web page to access Operator functionality (Sometimes you can guess where they are, but if you want to see exactly where the microformats are, you can turn on Highlight Microformats in Options). If you want to access Operator from the status bar, go to Options and check the box that says Display icon in status bar. If you want to acesss Operator as a toolbar button, select View->Toolbars->Customize… There is an Operator toolbar button that can be dragged into the Firefox user inteface. Once you have done either of these, you can go to View->Toolbars and turn off the Operator Toolbar.

This release introduces a basic user interface for installing user scripts. Note that ability to add user scripts has always been there, I’ve just never had a good UI. User scripts can be used to add new microformats and new actions to Operator. As a part of the introduction of this UI, I’m moving some of what I call the non tier 1 microformats out of the core Operator and made them available as user scripts. My decision as to which ones to remove was mainly based on which microformats fit best into the Operator model; that is to say it is easy to provide actions that relate to the microformat. It is very important for you to realize that user scripts have FULL JavaScript privileges. Do NOT install Operator user scripts unless you trust the people that are providing them. I am going to make all my scripts available at http://www.kaply.com/weblog/operator-user-scripts/. If you want to write your own actions or microformats, feel free to look at my scripts, but please be aware that this API is very much in flux. I don’t a good versioning mechanism right now, so at some point your scripts would cease to work. Note that I continue to support the original Operator action model, but not the original Operator microformats model. The microformats model is actually pretty close to final.

When I first created Operator, my stated goal was take the microformats that are on a web page and provide functionality up and above what was available in the web browser. Unfortunately, when I first started creating actions for the microformats, some of the actions I created were just a case of moving browser interaction into the Operator menus. (Go to web page being the best example). With the advent of a user interface for user scripts, I’ve taken the opportunity to move some of the function that shouldn’t have been there in the first place out of the core. Note that no functionality has been removed; it is all available as user scripts. If you have a very strong opinion on this, one way or the other, please let me know.

All that being said, let me outline the new features in Operator.

  • User interface for managing user scripts
  • Operator updated when DOM nodes are added or removed
  • Export All available for contacts and events
  • 30 Boxes support has been greatly improved
  • Interaction problems with McAfee SiteAdvisor are fixed
  • Major performance enhancements
  • Native getElementsByClassName is used on Firefox 3
  • Operator wasn’t working correctly with frames and iframes
  • New tag action for searching for videos on YouTube

In addition to those changes to the core, the following user scripts are now available:

  • Send to Bluetooth (Mac only)
  • hAtom
  • Simple GRDDL RDF export
  • XFN
  • species

Operator and DOM Mutation Events

This is working so well, I have to tell the world.

I just added support for DOM Mutation events to Operator. So now when DOM nodes are added and removed from the document, Operator will update appropriately.

But that’s not the coolest part…

I added support for the DOMAttrModified event. So combined with Firebug, you can actually interactively modify your HTML to add/remove/modify a microformat and Operator will update live based on the changes you make. It’s REALLY sweet.

New version coming soon….

SXSW Wrapup

I’m back to work after an action packed few days.

SXSW Interactive started Friday night and when I got there, the line was outrageous, so I thought I was going to miss the first panel I wanted to attend. After waiting a little bit, I mentioned to a volunteer I was a panelist and he said “What are you waiting in this line for?” and sent me to the panelist check-in. Membership has its privileges :) . After getting my badge, I went to How to Rawk SXSW. This gave me a chance to meet Tantek in person which was cool. Then I grabbed some free food at a party and headed home.

Saturday I skipped SXSW and instead headed with my wife and a couple friends to San Antonio to volunteer at the Dave Ramsey Live Event. Awesome time. It’s actually the fifth time we’ve volunteered. I can’t recommend this event enough (or Dave Ramsey in general) if you are looking to get control of your finances.

Sunday morning I got up a little late and rolled in to SXSW. I missed the 10:00 round, but caught Non-Developers to Open Source Acolytes: Tell Me Why I Care at 11:30 which was a really good session. After a quick lunch, I headed into the show floor to check out the booths, including the Firefox booth. Mary Colvig was there, as well as Rhian and Alex Polvi.

To start the afternoon, I went to Perspectives on Designing for Global Audiences which wasn’t what I expected, but at least I ran into Jonas Sicking. After that session, I went to AJAX or Flash: What’s Right for You? which was a great session about when Flash or Ajax is appropriate. Slides for that session are available at slideshare.net. That was followed up with The Future of JavaScript which convinced me to actually look forward to the sunsetting of Firefox 1.5 so I can use some new JavaScript features in Operator. At 5:00, I attended People-Powered Products where I learned about lulu.com which is a great site where you can publish your own stuff.

Sunday night, I went to the Microsoft party to get some free stuff, didn’t win the XBox 360, then headed over to the web awards for more free food. Then I decided to call it an early night.

Monday I got in a little later, but saw an interesting presentation by Timothy Ferriss on The 4-Hour Workweek. While I don’t agree with his stance on debt and credit, the presentation was very interesting and gave me some interesting things to think about, in particular the concept of selective ignorance. Looking forward to the book. At 11:30, I went to American Cancer Society: Applying Disruptive Technology for the Nonprofit Sector which was an excellent presentation about what the American Cancer Society is doing to embrace new technology. The coolest thing they showed was the Second Life Relay For Life. After the session, I got to talk with a couple guys about developing church websites and maybe got some leads on help for updating our church website.

After that session, It was almost go time for the microformats panel. I went back to the show floor and lost track of time, so I was a little late to the green room, but no one else was there yet, so I was OK. Once everyone showed up, we chatted a little about the order of things and then Tantek put on his T-shirts and we headed over. The room was full, depsite being up against Dan Rather. I thought the panel went great. You can check out some photos or blog posts including Wired. Lots of people came up afterwards with good things to say about Operator, including some folks from Yahoo!, Apple and emurse. Also got a chance to meet Eric Meyer. He made a nice comment about Operator moving forward the semantic web. I also met a guy from developerWorks who wants to put microformats on their website. After the session, I helped a guy from opensoul.org debug a problem in Operator which I fixed, as well as a problem with his site which he fixed.

After the session, I caught the tail end of Warren Spector on The Future of Storytelling and then went to the WaSP Annual Meeting: Takin’ it to the Street.

After the sessions, I was looking forward to the Mozilla Democracy Party, so I headed over. They had some good BBQ but I realized my place was at home with my family, so after eating, I headed out. Here’s some pics of the party.

Tuesday I wanted to be there at ten to catch Browser Wars Retrospective: Past, Present and Future Battlefields. Two very cool things during this panel – first, Arun plugged Operator in one of the questions, and second I realized that I knew Arun from a way previous life when I worked on the OS/2 version of Netscape Navigator out at Netscape. The session as a whole was very interesting. Also very cool is that I ran into Steve Ganz before the session, who I know only because I use his resume for testing hResume :) .

The last session I attended at SXSW was After Bust 2.0: Ten Years Later, Where Will We Be? which was an entertaining session, although not terribly informative. After the session I grabbed a quick lunch at P.F. Chang’s and then realized that the weather was getting bad. I decided to head home early so I didn’t get caught in the rain.

All in all, a great conference although I desperately wish IBM had been there demoing more of our stuff. In particular, we have two products that would have been great to see here, the AJAX Toolkit Framework for developing AJAX applications and our enterprise social software, Lotus Connections.

Incidentally, here’s some cool pictures of the river behind our house before and during the rain (we’re 90 feet up, so we don’t have to worry about it). Unfortunately, we didn’t get a picture when the water was really high, completely covering the area on the left.

Before the rain:

Before The Rain

During the rain:

During The Rain

SXSW – Posting from my Wii (mostly)

If you are going to be at SXSW this year, you can catch me at the microformats panel on Monday at 2. I’ll also be at the Mozilla/Democracy party Monday night.

(Feel free to use Operator to add those events to your calendar – both of those pages use microformats)

Operator Source Code is Finally Available

Update:ufJS and ufJSParser have ended up being integrated into Microformats.js. This will also be the core microformats code in Firefox 3. The API is documented here.

My apologies for taking so long, but the Operator source code is finally on svn.mozilla.org

For now, this includes ufJS and the ufJSParser. I am working on creating a separate project elsewhere to specifically cover the ufJS work, but for now it will be hosted with Mozilla labs.

The code is available under the trilicense.

Obviously I will accept contributions, but there is the potential that the ufJS work will be available under a different license such as the CPL, so contributors need to be aware of that.

The code in SVN corresponds to 0.7a plus hAtom support as well as fixes for the McAfee SiteAdvisor problems.

Enjoy.

Page 3 of 6«12345»...Last »