cd /news/developer-tools/nvalt-bookmarklet · home topics developer-tools article
[ARTICLE · art-8190] src=gist.github.com ↗ pub= topic=developer-tools verified=true sentiment=· neutral

nvALT Bookmarklet

JavaScript bookmarklet for nvALT that captures a webpage's title and URL, along with any selected text formatted as a blockquote. If text is selected, it creates a new note with the quote; otherwise, it saves the page link, optionally via Instapaper. The code is presented as a hidden or bidirectional text file on GitHub.

read1 min views24 publishedAug 5, 2011

gistfile1.js

  This file contains hidden or 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

Show hidden characters
javascript:(function({

  var INSTAPAPER=true,w=window,d=document,pageSelectedTxt=w.getSelection?w.getSelection():(d.getSelection)?d.getSelection():(d.selection?d.selection.createRange().text:0),pageTitle=d.title,pageUri=w.location.href,tmplt="";

  tmplt="From ["+pageTitle+"]("+pageUri+"):\n\n";

  if(pageSelectedTxt!="") {

    pageSelectedTxt=">%20"+pageSelectedTxt;

    pageSelectedTxt=pageSelectedTxt.replace(/(\r\n|\n+|\r)/gm,"\n");

    pageSelectedTxt=pageSelectedTxt.replace(/\n/g,"\n>%20\n>%20");

    w.location.href="nvalt://make/?txt="+encodeURIComponent(tmplt+pageSelectedTxt)+"&title="+encodeURIComponent(pageTitle)

  }

  else {

    if(INSTAPAPER) {

      pageUri="http://www.instapaper.com/m?u="+encodeURIComponent(pageUri)

    };

    w.location.href="nvalt://make/?url="+encodeURIComponent(pageUri)+"&title="+encodeURIComponent(pageTitle)

  }

})();
── more in #developer-tools 4 stories · sorted by recency
── more on @instapaper 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/nvalt-bookmarklet] indexed:0 read:1min 2011-08-05 ·