CmdUtils.CreateCommand({ names: ["tweetviz", "viz"], homepage: "http://www.tweetviz.com/", author: {name: "Damian Keeghan", email: "dkeeghan@gmail.com"}, license: "GPL", description: "Open the selected search term in the TweetViz Twitter Visualiser", help: "Open a TweetViz search using the selected search term and visualiser type. You can search for a standard string, or can use any of the Twitter aliases, including: from:username, to:username, @username and #hastags. You can also link search terms together using OR or AND.", arguments: [{role: "object", nountype: noun_arb_text, label: "Search Term"}, {role: "format", nountype: ["list", "zoom"], label: "Visualiser Mode"}], _checkFormat: function(formatText){ if(formatText.toLowerCase()=="list"){ return "list"; } else if(formatText.toLowerCase()=="zoom"){ return "zoom"; } else { return "list"; } }, preview: function(pblock, arguments) { var msg = "

You are searching TweetViz for '${search_text}' using the '${visualiser_type}' visualiser. (Valid visualisers are 'zoom' and 'list')

You can use all of the standard twitter search aliases, including:

Or you can search for any standard string.

Search terms can be linked together using OR or AND.

"; pblock.innerHTML = _(msg, {search_text: arguments.object.text, visualiser_type: this._checkFormat(arguments.format.text)}); }, execute: function(arguments) { var url = "http://www.tweetviz.com/#/"+escape(this._checkFormat(arguments.format.text))+"/"+escape(arguments.object.text); Utils.openUrlInBrowser(url); CmdUtils.setLastResult(url); } });