Skip to content

Instantly share code, notes, and snippets.

@asafd1
asafd1 / 666
Created May 2, 2010
call JS from preview html example
View 666
CmdUtils.CreateCommand({
names: ["666"],
domain: "seret.co.il",
arguments: [
{role: "object", label: 'what', nountype: noun_arb_text}
],
description: "seret.co.il חפש סרט באתר",
icon: "http://www.seret.co.il/favicon.ico",
homepage: "http://sites.google.com/site/ubiquityisrael",
author: { name: "Asaf David", email: "asafd1@gmail.com"},
View search-backup
function searchDomainPreview(pblock, domain, args) {
var txt = jQuery.trim( args.object.text );
var jsonURL = "http://ajax.googleapis.com/ajax/services/search/web?q=site:" + domain +" " + txt + "&v=1.0&rsz=large&callback=?";
pblock.innerHTML = "Searching for " + txt + ' on <a title="' + domain + '" target="_blank" href="' +domain+ '/">' + domain + '...</a>';
jQuery.getJSON(jsonURL,
function (data) {
if (data.responseData.results &&
data.responseData.results.length > 0) {
@asafd1
asafd1 / goto-url
Created May 1, 2010
goto url commands
View goto-url
CmdUtils.CreateCommand({
names: ["goto-url", "לך-לכתובת"],
homepage: "http://sites.google.com/site/ubiquityisrael",
author: {name: "Asaf David"},
description: "Opens a new tab with the selected URL",
takes: {"URL": noun_type_url},
preview: function(pblock, url) {
var template = "Open a new tab with " + url.text;
pblock.innerHTML = template;
@asafd1
asafd1 / google search israeli sites
Created Apr 30, 2010
חיפוש באתרים ישראליים
View google search israeli sites
CmdUtils.CreateAlias({names: ["עםםעךק", "גוגל"], verb: "Google"});
CmdUtils.CreateAlias({names: ["םפקמ", "פתח"], verb: "open"});
CmdUtils.CreateAlias({names: ["ךןדא", "רשימת-פקודות"], verb: "list"});
CmdUtils.CreateAlias({names: ["עםאם-ורך"], verb: "goto-url"});
CmdUtils.CreateAlias({names: ["כקקךןמע-ךובלט"], verb: "feeling-lucky"});
CmdUtils.CreateAlias({names: ["א'קקא", "טוויט"], verb: "tweet"});
CmdUtils.CreateAlias({names: ["אפ", "א'קקא-פשעק", "טוויט-דף"], verb: "tweet-page"});
function previewSearch(pblock, args, domain){
var txt = jQuery.trim( args.object.text );
@asafd1
asafd1 / tweet-page
Created Apr 22, 2010
twitter commands
View tweet-page
const TWITTER_STATUS_MAXLEN = 140;
CmdUtils.CreateCommand({
names: ["tweet-page", "tp"],
arguments: [
{role: "object", label: 'status', nountype: noun_arb_text},
{role: "alias", nountype: noun_type_twitter_user}
],
icon: "http://twitter.com/favicon.ico",
description:
View tweet command for ubiquity
const TWITTER_STATUS_MAXLEN = 140;
CmdUtils.CreateCommand({
names: ["tweet", "share using twitter"],
arguments: [
{role: "object", label: 'status', nountype: noun_arb_text},
{role: "alias", nountype: noun_type_twitter_user}
],
icon: "http://twitter.com/favicon.ico",
description: