Skip to content

Instantly share code, notes, and snippets.

@gialloporpora
gialloporpora / x
Created February 16, 2009 18:23 — forked from canadaduane/download-files.js
download-file by Duane Johnson
/*
This code is created by Duane Johnson, I have only modified the line 252 to show only the filename (not complete URL) in preview. Encapsulated the files in preview within UL tag
Ubiquity Command: download-files [regexp pattern] to [folder]
Author: Duane Johnson
Email: [email protected]
Description: Downloads files matching the regular expression pattern to a folder.
Changes:
2009-02-15
/* Unfortunatelly the JSON API not show a description of the story, to have it it must to parse the RSS data */
/* I must add the ability to search in localized languages, tomorrow */
CmdUtils.CreateCommand({
name: "bloglines-search",
icon: "http://www.bloglines.com/favicon.ico",
takes: {input : noun_arb_text},
preview: function(pblock, input) {
CmdUtils.previewAjax( pblock, {url: "http://www.bloglines.com/search",
type: "GET",
data: {q : input.text, s : "fr", pop: "l",news:"m", format:"json"},
@gialloporpora
gialloporpora / x
Created March 5, 2009 11:22
Draft of unread command for MozillaItalia forum
function NounSMFAjax(name, url) {
var noun_ajax_prototype={
_name: name,
_url : url,
_topic_list: null,
_callback: function( unread) {
noun_ajax_prototype._topic_list=unread;
},
getData: function( callback) {
jQuery.get(noun_ajax_prototype._url, function ( data ) {
@gialloporpora
gialloporpora / x
Created March 5, 2009 12:46
Bitly command to short long url
/* Messages used by this command */
var bitly_msg= {
description: "Shorten a long URL using Bit.ly API",
shorturl : "Short URL",
generalerror: "<b>WARNING:</b> Service is not available",
invalidurl: "Invalid Url Format"
}
/* There is a bug in Ubiquity under windows with selection and copy in clipboard of text from preview. For this reason I put the shortened url in clipboard */
/* TODO
From Abi:
I think the ones I most often use would be to check the current status
of a specific friend (or maybe, the last 3 statuses). The ability to
check your friends timeline as a whole would also be nice.
*/
// max of 140 chars is recommended, but it really allows 160... but that gets truncated on some displays? grr
// max of 140 chars is recommended, but it really allows 160
const IDENTICA_STATUS_MAXLEN = 160;
CmdUtils.CreateCommand({
name: "mozillaca",
icon: "",
takes: {status: noun_arb_text},
modifiers: {},
preview: function(previewBlock, statusText) {
/* This is a template command. */
CmdUtils.CreateCommand({
names: ["example"],
description: "A short description of your command.",
help: "How to use your command.",
author: {
name: "Your Name",
email: "[email protected]",
homepage: "http://labs.mozilla.com/",
},
/* This command open the profile folder */
function openLocalFolder(dir){
nsLocalFile = Components.Constructor("@mozilla.org/file/local;1","nsILocalFile", "initWithPath");
new nsLocalFile(dir).reveal();
}
CmdUtils.CreateCommand({
names: ["open-profile"],
description: "Open the profile directory in your file explorer..",
help: "Type open-profile to open the profile folder.",
author: {
/* This command open the profile folder */
function openLocalFolder(dir){
nsLocalFile = Components.Constructor("@mozilla.org/file/local;1","nsILocalFile", "initWithPath");
new nsLocalFile(dir).reveal();
}
CmdUtils.CreateCommand({
names: ["open-profile"],
description: "Open the profile directory in your file explorer..",
help: "Type open-profile to open the profile folder.",
author: {
const STATUSNET_STATUS_MAX_LEN = 140;
const STATUSNET_DOMAIN = "mozilla.status.net";
const STATUSNET_NAME = "mozilla status"; /* Change the name of command manually */
var noun_type_statusnet_user = {
label: "user",
rankLast: true,
noExternalCalls: true,
cacheTime: 0,
suggest: function nt_twuser_suggest(text, html, cb, selected) {