Skip to content
TORNLIFE More

[userscript] f*ck imgur

Started by Ahab [1735214] on in Tools & Userscripts.

13 replies · 585 views · thread synced · 3 days ago · View on torn.com
About this thread

Posts archived: 14 / 14 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

Counted by TornLife from the archived posts.

Archived posts
14
Discussion span
→
People posting
6
Likes on archived posts
28
Authority score
52 / 100
Historical score
31 / 100
Story score
42 / 100
Engagement score
69 / 100
BritishBenji [2257611]

Simple script, appears to work a charm for both posts and signatures

 

Only tweak I'd like to request is your

// @match 

To only cover Torn sites (but I'll be doing that on my end regardless, I guess some people will want it to be universal)

 

Thanks!

Ahab [1735214]

I did just have it on torn than thought meh I will prob run in to imgur links elsewhere might as well just open it up.

 

// @match   https://www.torn.com/profiles.php*
// @match   https://www.torn.com/forums.php*

// @match   https://www.torn.com/factions.php*

// @match   https://www.torn.com/bazaar.php*

 

could prob narrow it to just profiles and the board tbh..... okay everywhere there could be links so bazaar's, factions etc

 

or just all of torn so it hits the chat as well
// @match   https://www.torn.com/*

 

 

Frengesp [3730896]

not a fan of imgur but had to try it since photobucket wants to charge me to recover my old account full of ebay things i was selling. Ya no thanks. Is flickr actually better or at least quite different? I might sign up.

Ahab [1735214]

Should work for single image page urls as imgur don't seem to care what the extension is... for what I've tested anyway (png, jpg, gif)

   if(el.tagName === 'A'){
        const href = el.getAttribute('href');
        const regex = /^(?:https?://)?(?:www.)?imgur.com/([A-Za-z0-9]{5,})$/;
        const match = regex.exec(href);
        if(href && href.includes('i.imgur') && !href.includes('proxy.duckduckgo')){
            el.setAttribute('href', ddg + href);
        }
        if(href && match && !href.includes('proxy.duckduckgo')){
            const url = ddg + `https://i.imgur.com/${match[1]}.png`;
            el.setAttribute('href', url);
        }
    }


https://pastebin.com/NWaJbAyv

Not going to update the script till ran it for a bit, but for anyone that wants to test it is here to copy paste in.

 

edit

These urls https://imgur.com/ryoQgJY