Skip to content

Instantly share code, notes, and snippets.

@alx
Created November 13, 2008 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alx/24552 to your computer and use it in GitHub Desktop.
Save alx/24552 to your computer and use it in GitHub Desktop.
CmdUtils.CreateCommand({
name: "press",
description: "Posts selected content from the current page to Pressmark.",
help: "Posts selected content from the current page to Pressmark.",
icon: "http://bookmark.alexgirard.com/favicon.ico",
homepage: "http://bookmark.alexgirard.com",
author: { name: "Alex Girard", email: "alex@lasindias.com"},
contributors: ["Alex Payne"],
license: "WTFPL",
takes: {"link description": noun_arb_text},
execute: function(directObj) {
var d = Application.activeWindow.activeTab.document;
var e = encodeURIComponent;
var post_text = directObj.text || context.focusedWindow.getSelection();
var post_url = d.location.href;
var post_title = d.title;
var url = 'http://bookmark.alexgirard.com/index.php?posttext=' + e(post_text) + '&posturl=' + e(post_url) + '&posttitle=' + e(post_title);
Utils.openUrlInBrowser(url);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment