// ==UserScript==
// @name Digg replace comments
// @namespace http://userscripts.org
// @description Replace digg comments with reddit comments
// @include http://digg.com/*
// @include http://*.digg.com/*
// ==/UserScript==
// Check if Prototype's loaded
function GM_wait() {
if(typeof unsafeWindow.Prototype == 'undefined') { window.setTimeout(GM_wait,100); }
else { $ = unsafeWindow.Prototype; letsPrototype(); }
}
GM_wait();
// All your GM code must be inside this function
function letsPrototype() {
var getLink = $('title').childNodes[0].href;
$('wrapper').getElementsByClassName('comment').first().hide();
$('sub-nav').setStyle({clear: "both", marginBottom: 35});
new Insertion.After('sub-nav', '
Loading Reddit Comments

');
GM_xmlhttpRequest({
method: 'GET',
url: 'http://reddit.com/search?q=http://travel.state.gov/passport/eppt/epptnew_2807.html',
headers: {
'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',
},
onload: function(responseDetails) {
var data = responseDetails.responseText;
if (data.indexOf("also submit to reddit") === -1){
var trimmedData = data.slice(data.indexOf(''),data.indexOf("