Skip to content

Instantly share code, notes, and snippets.

@punytan
Created February 14, 2011 14:09
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 punytan/825918 to your computer and use it in GitHub Desktop.
Save punytan/825918 to your computer and use it in GitHub Desktop.
Open feed item with InstaReader in background by pressing 'v'
// ==UserScript==
// @name Google Reader with InstaReader
// @namespace http://linknode.net
// @description Open feed item with InstaReader in background by pressing 'v'
// @include http*://www.google.com/reader/view/*
// ==/UserScript==
document.addEventListener('keypress', function(event) {
if(event.which == 118) { // 118 is 'v'
if (document.getElementById('current-entry') == null) return; // no current entry
var link = document.getElementById('current-entry').getElementsByTagName('a').item(0).getAttribute('href');
var url = 'http://www.instapaper.com/text?u=' + encodeURIComponent(link);
event.stopPropagation();
event.preventDefault();
GM_openInTab(url);
}
}, true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment