*Depricated* Digg Later on Instapaper

By Jsatt Last update Apr 5, 2009 — Installed 393 times.

There are 1 previous version of this script.

//Digg Later
//Version 2.0
//By Jeremy Satterfield
//Released under
//Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License
//http://creativecommons.org/licenses/by-nc-sa/3.0/

//Adds a button to your Digg pages to save a link
//to the Digg in your Instapaper.com account for
//later review without having to digg it.

// ==UserScript==
// @name          Digg Later on Instapaper
// @namespace     http://jsatt.blogspot.com
// @description   Adds a "Read Later" link to quickly post to Instapaper.com.
// @include       http://digg.com/*
// @include       http://www.digg.com/*
// ==/UserScript==

//To allow single click saves to instapaper, 
//paste your customized bookmark from instapaper below;
var bookmark = "paste your bookmark here";

//the script will do the rest...
$ = unsafeWindow.jQuery;

if(bookmark.length > 25){
	var ukey=/k=[\w\d]+&u=/.exec(bookmark)[0].replace(/k=/,"").replace(/\&u=/,"");;
}else{
	var ukey='';
}

$(function(){
	$('.news-body').each(function(){
		var ttl;
		var url;
		$(this).children('h3').children('a.offsite').each(function(){
			ttl = $(this).text();
			url = $(this).attr('href');
		})
		$("<a></a>")
			.attr("href","javascript:var%20doc=document,win=window,ws=win.getSelection,ds=doc.getSelection,ss=doc.selection,sel=(ws?ws():(ds)?ds():(ss?ss.createRange().text:0)),bu='http://www.instapaper.com/b',loc=doc.location,en=encodeURIComponent,pu='?v=4&k="+ukey+"&u='+en('"+url+"')%20+'&t='+en('Digg: "+ttl.replace(/\'/gi,"\\\'")+"')%20+'&s='+en(sel),url=bu+pu;try{if(!/^(.*\.)?instapaper([^.]*)?$/.test(loc.host))throw(0);iptstbt();}catch(z){op%20=function(){if(!win.open(url,'t','toolbar=0,resizable=0,status=1,width=250,height=150'))loc.href=url;};if(/Firefox/.test(navigator.userAgent))setTimeout(op,0);else%20op();}void(0)")
			.html("Read Later")
			.addClass("tool")
			.addClass("faved")
			.prependTo($(this).children("div.news-details"));
	})
})