Softcobra Decoder

decodes links on softcobra.com

< Feedback on Softcobra Decoder

Review: Bad - script does not work

cdb
§
Posted: 2023-05-03

I've written my own working SoftCobra decoder script here https://greasyfork.org/en/scripts/465406-softcobra-nin10news-decoder which contains the following code:


// ==UserScript==
// @name SoftCobra / Nin10News Decoder
// @version 1.0
// @author Chris Barlow
// @description Automatically convert all SoftCobra.com link codes into clickable links which automatically redirect to the link code's decoded link.
// @namespace softcobra_nin10news
// @license MIT
// @match *://softcobra.com/*
// @match *://www.softcobra.com/*
// @match *://nin10news.com/decode*
// @match *://www.nin10news.com/decode*
// @icon https://www.google.com/s2/favicons?sz=64&domain=softcobra.com
// @require http://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js
// @run-at document-start
// ==/UserScript==

(function() {
///////////////////////////////////////////////////////////////////////////////////////////////

const safeInterval = (fn, ms) => {
return setInterval(()=>{
if (!document.hasFocus()) return
fn()
}, ms)
}

const init = () => {
// softcobra.com
if (location.host.endsWith('softcobra.com')) {
safeInterval(() => {
$('article > .entry-content-wrapper > .entry-content tr > td:not(.cdb)')
.filter((i,o) => {
let hash = o.innerText.trim()
return hash.length > 40 && !hash.includes(' ')
})
.each((i,o) => {
$(o).replaceWith($(`

${o.innerText}

`))
})
}, 1000)
}

// nin10news.com
else if (location.host.endsWith('nin10news.com')) {
let url = '/wp-content/themes/twentysixteen/inc/decode.php'
let hash = unescape(location.hash.replace('#hash=', ''))
$.post(url, {data: hash}, (res) => {
let url = atob(res)
if (!url.startsWith('http')) return
location = url
})
}
}
init();

////////////////////////////////////////////////////////////////////////////////////////////////////
})();

Post reply

Sign in to post a reply.