Charl van Niekerk » Blog

Main

Latest

Archives

Powered by Blogger

Operator AMA User Scripts

Yesterday I tried out the new Firefox Operator 0.8a extension. Then I took a look at the Operator User Scripts page. I saw the corkd script and thought that it would be trivial to create similar scripts for Afrigator, Amatomu and Muti (in alphabetical order).

So I hacked away and came up with these three. For Afrigator:

var afrigator_search_tags = {
  description: "Find posts on Afrigator",
  shortDescription: "Afrigator",
  icon: "http://afrigator.com/favicon.ico",
  scope: {
    semantic: {
      "tag" : "tag"
    },
    url: "http://afrigator.com"
  },
  doAction: function(semanticObject, semanticObjectType) {
    if (semanticObject.tag) {
      return("http://afrigator.com/tag/" + encodeURIComponent(semanticObject.tag));
    }
  }
};

SemanticActions.add("afrigator_search_tags", afrigator_search_tags);

For Amatomu:

var amatomu_search_tags = {
  description: "Find posts on Amatomu",
  shortDescription: "Amatomu",
  icon: "http://amatomu.com/favicon.ico",
  scope: {
    semantic: {
      "tag" : "tag"
    },
    url: "http://amatomu.com"
  },
  doAction: function(semanticObject, semanticObjectType) {
    if (semanticObject.tag) {
      return("http://amatomu.com/tag.php?tag=" + encodeURIComponent(semanticObject.tag));
    }
  }
};

SemanticActions.add("amatomu_search_tags", amatomu_search_tags);

And finally, for Muti:

var muti_search_tags = {
  description: "Find links on Muti",
  shortDescription: "Muti",
  icon: "http://muti.co.za/images/favicon.ico",
  scope: {
    semantic: {
      "tag" : "tag"
    },
    url: "http://muti.co.za"
  },
  doAction: function(semanticObject, semanticObjectType) {
    if (semanticObject.tag) {
      return("http://muti.co.za/hot?tags=" + encodeURIComponent(semanticObject.tag));
    }
  }
};

SemanticActions.add("muti_search_tags", muti_search_tags);

Now, you probably need some instructions for installation. Took me a while to figure this out myself.

  1. Save any or all of the above code snippets, each to their own file. For example, you can save the Muti script to muti.js anywhere on your computer. You can probably put them all in the same file if you like, haven't tried that myself yet.
  2. Open Operator's options window.
  3. Go to the "User Scripts" tab.
  4. Add each of your scripts by clicking on the "New" button and selecting a script.
  5. Restart Firefox.
  6. Go back to the options window.
  7. Go to the "Actions" tab.
  8. Add each of the services by clicking on "New" and selecting a service from the drop-down list.
  9. You will probably have to do some reordering and/or deleting as well while you're in the "Actions" tab. Click "Ok" when you're done and browse to any web page that uses rel-tag.

Enjoy! If you have any problems or questions, please do not hesitate to contact me or leave a comment. Thanks!

2 Comments

Comment by Blogger Neil Blakey-Milner on Friday, June 08, 2007 3:45:00 PM

Those user scripts look quite neat - would be easy to "send" an event to your own personal calendar server, for example.

Comment by Blogger Charl van Niekerk on Wednesday, June 13, 2007 10:22:00 AM

Yes and what about being able to submit events to iJol!

Post a Comment

Copyright © 2004-2009 Charl van Niekerk. All articles are released under the Creative Commons Attribution 2.5 South Africa licence, unless where otherwise stated.