CmdUtils.CreateCommand({
  name: "later",
  homepage: "http://www.duncanandmeg.org/projects/ubiquity.php",
  author: { name: "Duncan Johnson", email: "duncan@duncanandmeg.org"},
  license: "GPL",
  description: "Saves current page to read later on Instapaper.",
  icon: "http://www.instapaper.com/favicon.png",
  help: "If you select some text from the page, it will be stored as the summary.",
  preview: "Saves current page to read later on Instapaper.",
  
  execute: function() {
 
var d = CmdUtils.getDocumentInsecure(), w = CmdUtils.getWindowInsecure()
var e = w.getSelection, k = d.getSelection, x = d.selection
var s = CmdUtils.getTextFromHtml(CmdUtils.getHtmlSelection())
var f = "http://www.instapaper.com/b"
var l = d.location, e = encodeURIComponent, p = "?v=4&k=j88j81EbHqJk&u=" + e(l.href) + "&t=" + e(d.title) + "&s=" + e(s), u = f + p;
try {
    if (!/^(.*\.)?instapaper([^.]*)?$/.test(l.host)) {
        throw 0;
    }
    iptstbt();
} catch (z) {
    a = function () {if (!w.open(u, "t", "toolbar=0,resizable=0,status=1,width=250,height=150")) {l.href = u;}};
    //if (/Firefox/.test(navigator.userAgent)) {
    //    setTimeout(a, 0);
    //} else {
        a();
    //}
}
void 0;
  
  }

})
