share-to-reader
I learned about the ability to post to google reader directly and having a way to do it from Ubiquity would be awesome. I looked around and found a script here: Jeremy Pyne. I then made some changes to make it work with the new parser and am going to work on getting tags and other data to come directly from the command. The new version is here:
CmdUtils.CreateCommand({
names: ["note-in-reader", "add-to-reader", "share-to-reader"],
homepage: "http://www.subtlysimple.com/projects/share-to-reader",
author: { name: "Kiran Prasad", email: "kiran@subtlysimple.com"},
description: "Share this page in Google Reader.",
arguments: [ {role: 'object', nountype: noun_arb_text, label: 'note'} ],
execute: function( args ) {
var document = Application.activeWindow.activeTab.document;
var gc = "var b=document.body;var GR________bookmarklet_domain='https://www.google.com';if(b&&!document.xmlVersion){void(z=document.createElement('script'));void(z.src='https://www.google.com/reader/ui/link-bookmarklet.js');void(b.appendChild(z));}else{}";
void(z=document.createElement('script'));
z.appendChild(document.createTextNode(gc));
document.body.appendChild(z);
if(args.note.text)
{
var timer = Components.classes["@mozilla.org/timer;1"]
.createInstance(Components.interfaces.nsITimer);
timer.initWithCallback(
function() {
document.getElementById("GR________link_bookmarklet_frame").contentDocument.getElementById("annotation").innerHTML= args.note.text;
},
1500,
Components.interfaces.nsITimer.TYPE_ONE_SHOT);
}
}
})
No comments yet.