Skip to content

Instantly share code, notes, and snippets.

@asafd1
asafd1 / 666
Created May 2, 2010 05:19
call JS from preview html example
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"},
@asafd1
asafd1 / search-backup
Created May 1, 2010 18:56
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 17:36
goto url commands
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 April 30, 2010 13:07
חיפוש באתרים ישראליים
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 April 22, 2010 23:33
twitter commands
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:
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: