1
edit
Changes
→show time in
=Ubiquity commands= ==Introduction== These are the results for the [[DPS909]]/[[OSD600]] [[Learning Collaborative Development Lab Fall 2008|lab 1]]. Place any and all common results, code, notes here.
====Zenit Wiki Search====
[[User:tjbro]]
This command allows a user to share a web page on Facebook. Although I couldn't get the preview to act the way I orginally had in mind I'm going to continue working on it in hopes of avoiding the pop-up window.
<br />
<pre>
CmdUtils.CreateCommand(
{
}
})
</pre>
<br />
---
---
====Sherdog Fight Finder Search====
[[User:bbarcick]]
This command allows a user to search the Sherdog Fight Finder for a specific fighter. Currently only allows the first word to be the fighters first name and the second word to be the fighters last name.
<br />
<pre>
CmdUtils.CreateCommand({
name: "fight-finder",
author: {name:"Bartosz Barcicki", email:"bartb_69@hotmail.com"},
description: "Searches the Sherdog Fight Finder",
takes: {"search-string": noun_arb_text},
preview: function(pblock, search) {
pblock.innerHTML = "Sherdog Fight Finder Search: " + search.text;
},
execute: function(search) {
var name = search.text.split(' ');
if (!name[1])
{
name[1] = "";
}
var url = "http://sherdog.com/fightfinder.php?firstname=" + name[0] + "&lastname=" + name[1] + "&search=yes&nickname=&association=&weight=";
Utils.openUrlInBrowser(url);
}
})
</pre>
<br />
---
====Start a new cl1p.net page====
by [http://johpan.thruhere.net/opensource/ Johann Manzano]:<br/>
I originally wanted to make it so that selected text would make it into the page created by this command but i couldn't figure it out. It'll be something I'll continue to look into when time permits.
cl1p.net is an internet clipboard like pastebin but you can select the name that your clipboard gets. This command allows you to select the name of the page via ubiquity and it loads it for you. If you don't supply a name, it just takes you to the site.
[http://johpan.thruhere.net/opensource/?p=7 original post here]
<pre>
function cl1pPage( name ) {
var url = "http://cl1p.net/" + name;
Utils.openUrlInBrowser(url);
}
CmdUtils.CreateCommand ({
name: "cl1p",
takes: {"page name": noun_arb_text},
preview: function(pBlock, directObj) {
if (directObj.text)
pBlock.innerHTML = "goto cl1p.net/" + directObj.text;
else
pBlock.innerHTML = "goto cl1p.net";
},
execute: function(directObj) {
var text = directObj.text
cl1pPage(text);
}
});
</pre>
----
====show time in====
[http://gist.github.com/128853 show-time-in] command by [[User: Jyoti | Jyoti]]
This command shows the current time in the place specified
CmdUtils.CreateCommand({
name: "show time in",
author: {name:"jyoti", email: "mail2jyoti88@gmail.com"},
description:"It will show the current time in the place you specified.",
takes: {"name of a place" : noun_arb_text},
_time: function(term)
{
return "http://www.timeanddate.com/worldclock/results.html?query="+term;
},
preview: function(pblock,pname)
{
var msg="It will show the current time in "+ pname.text;
pblock.innerHTML=msg;
},
execute: function(pname)
{
if (pname.text=="")
{
displayMessage("enter name of the place whose current time u want to know");
}
else
Utils.openUrlInBrowser(this._time(pname.text));
}
})