Skip to content

Instantly share code, notes, and snippets.

@gialloporpora
Created December 12, 2008 02:14
Show Gist options
  • Save gialloporpora/34992 to your computer and use it in GitHub Desktop.
Save gialloporpora/34992 to your computer and use it in GitHub Desktop.
Foxiewire command
CmdUtils.CreateCommand({
name: "foxiewire",
icon: "http://www.foxiewire.com/favicon.ico",
homepage: "http://www.gialloporpora.netsons.org/ubiquity",
description: "If not yet submitted, submits the page to Foxiewire. Otherwise, it takes you to the story's Foxiewire page.",
author: { name: "Sandro Della Giustina", email: "sandrodll@yahoo.it"},
takes: {"input": noun_arb_text},
license: "MPL,GPL",
execute: function( input ){
var doc = CmdUtils.getDocument();
var params = Utils.paramsToString({
q: 'submit',
url: doc.location.href,
title: doc.title,
body: input.text
});
story_url='http://www.foxiewire.com/' + params;
Utils.openUrlInBrowser(story_url);
},
preview: function(pblock) {
var html= 'Submit or vote this page to Foxiewire. Checking if this page has already been submitted...';
pblock.innerHTML=CmdUtils.renderTemplate(html);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment