Created
November 13, 2008 18:48
-
-
Save alx/24552 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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