Bitcoin Forum
October 14, 2026, 10:38:52 PM *
News: Serious possible issue involving Ledger hardware wallets and CryptoBilis
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [Userscript] show trusted/not-trusted of your PERSONAL trust list  (Read 239 times)
babo (OP)
Legendary
*
Offline

Activity: 4480
Merit: 5879


si vis pacem, para bellum


View Profile WWW
October 13, 2026, 12:57:31 PM
Last edit: Today at 07:18:02 AM by babo
Merited by Welsh (10), LoyceV (6), fillippone (6), Xal0lex (5), ABCbits (3), Vod (1), Bitcoin_Arena (1), Royal Cap (1), chinhar (1), GhostOfBitcoin (1)
 #1



Preamble

I was going crazy trying to figure out who was on my trust list and who wasn't, and I couldn't tell without going into the trust configuration every time.

DIY

So I decided to write a Greasemonkey script to handle this task, since I'm extremely lazy.
I wrote and tested it a bit, so if anyone wants to use it, I'm attaching the code here.

Code:
// ==UserScript==
// @name         Bitcointalk Trust Pills
// @namespace    https://bitcointalk.org/
// @version      1.0
// @description  Mostra una pill verde se l'utente è in trust list, rossa se è distrusted (~user)
// @match        https://bitcointalk.org/*
// @grant        none
// @author babo
// ==/UserScript==

(function () {
    'use strict';

    var CACHE_KEY = 'btcTrustMapV1';
    var CACHE_TIME_KEY = 'btcTrustMapTimeV1';
    var TTL = 24 * 60 * 60 * 1000; // 24h

    function parseTrustText(text) {
        var map = {}; // lower -> { name, trusted }
        text.split('\n').forEach(function (line) {
            var u = line.trim();
            if (!u) return;
            var trusted = true;
            if (u.charAt(0) === '~') {
                trusted = false;
                u = u.slice(1).trim();
            }
            if (!u) return;
            map[u.toLowerCase()] = { name: u, trusted: trusted };
        });
        return map;
    }

    function loadCache() {
        try {
            var t = parseInt(localStorage.getItem(CACHE_TIME_KEY) || '0', 10);
            if (Date.now() - t > TTL) return null;
            var raw = localStorage.getItem(CACHE_KEY);
            return raw ? JSON.parse(raw) : null;
        } catch (e) { return null; }
    }

    function saveCache(map) {
        try {
            localStorage.setItem(CACHE_KEY, JSON.stringify(map));
            localStorage.setItem(CACHE_TIME_KEY, String(Date.now()));
        } catch (e) {}
    }

    function applyPills(map) {
        if (!map) return;
        document.querySelectorAll('td.poster_info').forEach(function (td) {
            if (td.querySelector('.btc-trust-pill')) return;
            var a = td.querySelector('b a') || td.querySelector('a');
            if (!a) return;
            var username = (a.textContent || '').trim();
            if (!username) return;
            var entry = map[username.toLowerCase()];
            if (!entry) return; // utente non in lista: nessuna pill
            var pill = document.createElement('span');
            pill.className = 'btc-trust-pill';
            pill.textContent = entry.trusted ? '✓ Trusted' : '✕ Distrusted';
            pill.style.cssText = entry.trusted
                ? 'display:inline-block;padding:1px 8px;border-radius:10px;font-size:11px;font-weight:bold;background:#28a745;color:#fff;margin-left:6px;vertical-align:middle;'
                : 'display:inline-block;padding:1px 8px;border-radius:10px;font-size:11px;font-weight:bold;background:#dc3545;color:#fff;margin-left:6px;vertical-align:middle;';
            var b = td.querySelector('b');
            (b || a).after(pill);
        });
    }

    function fetchTrustList() {
        fetch('https://bitcointalk.org/index.php?action=trust', { credentials: 'include' })
            .then(function (res) { return res.text(); })
            .then(function (html) {
                var m = html.match(/<textarea[^>]*name=["']trustlist["'][^>]*>([\s\S]*?)<\/textarea>/i);
                if (!m) return;
                var text = m[1].replace(/&amp;/g, '&').replace(/&lt;/g, '<').replace(/&gt;/g, '>');
                var map = parseTrustText(text);
                saveCache(map);
                applyPills(map);
            })
            .catch(function () {});
    }

    if (/action=trust/i.test(location.href)) {
        var ta = document.querySelector('textarea[name="trustlist"]');
        if (ta) saveCache(parseTrustText(ta.value));
        return;
    }

    var cached = loadCache();
    if (cached) applyPills(cached);
    fetchTrustList();
})();


I'm sure @fillippone will love this

fillippone
Legendary
*
Online Online

Activity: 3038
Merit: 21620


Duelbits.com - Rewarding, beyond limits.


View Profile WWW
October 13, 2026, 04:20:18 PM
Merited by LFC_Bitcoin (3), babo (1)
 #2

Good work once again Babo.
Very good idea, and sadly I am out of merits atm. Will dump more as soon as I can.
Sadly, this extension could prove very useful given recent events.
I might suggest to *Ace* to blob in his own extension?

babo (OP)
Legendary
*
Offline

Activity: 4480
Merit: 5879


si vis pacem, para bellum


View Profile WWW
October 13, 2026, 07:29:28 PM
 #3

Ace made his extension and I made mine, I don't see the point of mixing them up so much to create and use new greasemonkeys, you don't pay them
I also want to see (I will do it later) if I am trusted by the person, so I want to add a pill like
"you are trusted" "you are not trusted" by this person

Now I'm studying how to do it

anyway thanks

Bitcoin_Arena
Copper Member
Legendary
*
Offline

Activity: 2800
Merit: 2132


฿itcoin for all, All for ฿itcoin.


View Profile
October 13, 2026, 09:25:43 PM
Merited by babo (1)
 #4

Interesting tool according to the description. Before checking out, it would be interesting to see how it appears on a forum page, but I am seeing an invalid image error (I don't know if it's just me). I think talkimg.com would do us some justice in this case.

.◼.◼.Vega.bet.◼.◼.██
██
██
██
██
██
██
██
██
██
██
██
██

...100 FS + 750% BONUS..MAX.WIN.$5,000...

███...FAST PAYOUTS  |  NO KYC  |  10% LOSSBACK...███
██
██
██
██
██
██
██
██
██
██
██
██
██

...Play Now...
TryNinja
Legendary
*
Offline

Activity: 3710
Merit: 11250


@ List of no-KYC websites: https://bitlist.co


View Profile WWW
October 13, 2026, 11:32:34 PM
Merited by babo (1), Pikiboy (1)
 #5

I'm not sure if I'm the only one, but the image isn't loading on my end.

Code:
https://i.ibb.co/MyNnG39Y/image.png

You have bitlist.co and talkimg to upload your images to, both from bitcointalk members. Roll Eyes

▄▄████████████████████▄▄
▄███████▀▀██████▀▀███████▄
█████▀██████████████▀█████
████████▄▄██████▄▄████▀███

██████████████████████████
██▄▄██████████████▄▄██████
██▀▀██████████████████▄▄██
██████▀▀██████████████▀▀██
██████████████████████████
███▄████▀▀██████▀▀████████
█████▄██████████████▄█████
▀███████▄▄██████▄▄███████▀
▀▀████████████████████▀▀
 
 DΞX.fo 
▄▄██████
█████████
██████████
██████████
██████████
█████████
▀▀██████

▄███████
▄██████████
████████████
█████████████
█████████████
|
▄▄█
▄████▀
▄███▀█▄
▄██▀█▄██
█████▀▀█
████████
████████
▀██▄████
▄████▄▄█
▄█████▀███
▄█████▀████▀
█████▀███████
▀██▀█████████
|..BTC......XMR...
..USDT.....LTC...
....Fees  0.8%.....
Pikiboy
Full Member
***
Offline

Activity: 256
Merit: 113


View Profile
October 13, 2026, 11:38:34 PM
Merited by babo (1)
 #6

I'm not sure if I'm the only one, but the image isn't loading on my end.

Code:
https://i.ibb.co/MyNnG39Y/image.png

You have bitlist.co and talkimg to upload your images to, both from bitcointalk members. Roll Eyes
I actually wanted to say this but just read a bit low and noticed you are also experiencing it at your end as well. Though was thinking it was network.
babo (OP)
Legendary
*
Offline

Activity: 4480
Merit: 5879


si vis pacem, para bellum


View Profile WWW
Today at 07:17:25 AM
 #7

I'm not sure if I'm the only one, but the image isn't loading on my end.

Code:
https://i.ibb.co/MyNnG39Y/image.png

You have bitlist.co and talkimg to upload your images to, both from bitcointalk members. Roll Eyes

when I try to use talkimg it always gives me an error, I can't upload files for about a month.. when I paste
When I upload a file it works, I don't understand why and it's inconvenient for me to save the file locally every time and then upload it manually... anyway I upload it there too and add the double image

chinhar
Full Member
***
Offline

Activity: 153
Merit: 106


View Profile
Today at 07:36:43 AM
Merited by babo (1)
 #8



Preamble

I was going crazy trying to figure out who was on my trust list and who wasn't, and I couldn't tell without going into the trust configuration every time.

DIY

So I decided to write a Greasemonkey script to handle this task, since I'm extremely lazy.
I wrote and tested it a bit, so if anyone wants to use it, I'm attaching the code here.

Code:
// ==UserScript==
// @name         Bitcointalk Trust Pills
// @namespace    https://bitcointalk.org/
// @version      1.0
// @description  Mostra una pill verde se l'utente è in trust list, rossa se è distrusted (~user)
// @match        https://bitcointalk.org/*
// @grant        none
// @author babo
// ==/UserScript==

(function () {
    'use strict';

    var CACHE_KEY = 'btcTrustMapV1';
    var CACHE_TIME_KEY = 'btcTrustMapTimeV1';
    var TTL = 24 * 60 * 60 * 1000; // 24h

    function parseTrustText(text) {
        var map = {}; // lower -> { name, trusted }
        text.split('\n').forEach(function (line) {
            var u = line.trim();
            if (!u) return;
            var trusted = true;
            if (u.charAt(0) === '~') {
                trusted = false;
                u = u.slice(1).trim();
            }
            if (!u) return;
            map[u.toLowerCase()] = { name: u, trusted: trusted };
        });
        return map;
    }

    function loadCache() {
        try {
            var t = parseInt(localStorage.getItem(CACHE_TIME_KEY) || '0', 10);
            if (Date.now() - t > TTL) return null;
            var raw = localStorage.getItem(CACHE_KEY);
            return raw ? JSON.parse(raw) : null;
        } catch (e) { return null; }
    }

    function saveCache(map) {
        try {
            localStorage.setItem(CACHE_KEY, JSON.stringify(map));
            localStorage.setItem(CACHE_TIME_KEY, String(Date.now()));
        } catch (e) {}
    }

    function applyPills(map) {
        if (!map) return;
        document.querySelectorAll('td.poster_info').forEach(function (td) {
            if (td.querySelector('.btc-trust-pill')) return;
            var a = td.querySelector('b a') || td.querySelector('a');
            if (!a) return;
            var username = (a.textContent || '').trim();
            if (!username) return;
            var entry = map[username.toLowerCase()];
            if (!entry) return; // utente non in lista: nessuna pill
            var pill = document.createElement('span');
            pill.className = 'btc-trust-pill';
            pill.textContent = entry.trusted ? '✓ Trusted' : '✕ Distrusted';
            pill.style.cssText = entry.trusted
                ? 'display:inline-block;padding:1px 8px;border-radius:10px;font-size:11px;font-weight:bold;background:#28a745;color:#fff;margin-left:6px;vertical-align:middle;'
                : 'display:inline-block;padding:1px 8px;border-radius:10px;font-size:11px;font-weight:bold;background:#dc3545;color:#fff;margin-left:6px;vertical-align:middle;';
            var b = td.querySelector('b');
            (b || a).after(pill);
        });
    }

    function fetchTrustList() {
        fetch('https://bitcointalk.org/index.php?action=trust', { credentials: 'include' })
            .then(function (res) { return res.text(); })
            .then(function (html) {
                var m = html.match(/<textarea[^>]*name=["']trustlist["'][^>]*>([\s\S]*?)<\/textarea>/i);
                if (!m) return;
                var text = m[1].replace(/&amp;/g, '&').replace(/&lt;/g, '<').replace(/&gt;/g, '>');
                var map = parseTrustText(text);
                saveCache(map);
                applyPills(map);
            })
            .catch(function () {});
    }

    if (/action=trust/i.test(location.href)) {
        var ta = document.querySelector('textarea[name="trustlist"]');
        if (ta) saveCache(parseTrustText(ta.value));
        return;
    }

    var cached = loadCache();
    if (cached) applyPills(cached);
    fetchTrustList();
})();


I'm sure @fillippone will love this
this is a really great tool, I must say that I will be happy to use it, adding superpowers to the forum is really useful, do you think that one day all these tools, which are now external, can be implemented directly in the forum?
that would be great

GhostOfBitcoin
Member
**
Offline

Activity: 120
Merit: 50

Contact TG: @GOB_CEO


View Profile WWW
Today at 10:04:10 AM
Merited by babo (1)
 #9

Ahh brother Babo, this has truly made me happy. I really like that you were able to solve your forum problem by creating a userscript with some coding logic.

I feel happy whenever I successfully do this kind of work. This userscript will be very helpful for all DT members, as they will be able to easily identify Trusted and Distrusted users.

I would like to make one suggestion: you could add a button to the userscript that displays the complete list of all Trusted and Distrusted users with just one click. I think this would make it even more useful. If you like the idea, you can consider it.

However, what you have already created is definitely a helpful tool that can save a lot of time.
babo (OP)
Legendary
*
Offline

Activity: 4480
Merit: 5879


si vis pacem, para bellum


View Profile WWW
Today at 10:09:47 AM
 #10

Thank you very much, of course. I'll add the button you mentioned because it's actually very useful for not having to constantly go to the aforementioned page (which, among other things, is also quite ugly and complex to read).
I also want to add, but I have to study how to understand if the person you are looking at is trusting you or not.
always because I'm lazy and going to the loycev site is a little inconvenient

LoyceV
Legendary
*
Offline

Activity: 4186
Merit: 22961


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
Today at 11:17:20 AM
Merited by babo (1)
 #11

I haven't tested it, so I'll ask here: does this only include "Depth 0"? It would be very interesting if you can add "Depth 1" and "2" (see my Personal Full Trust Depth viewer).
I keep DefaultTrust on my Trust list, so my Trust settings show even more names I don't recognize on "Depth 2", but even without DefaultTrust, it easily adds many users through "inclusions of inclusions of users on my Trust list".

¡uʍop ǝpᴉsdn pɐǝɥ ɹnoʎ ɥʇᴉʍ ʎuunɟ ʞool no⅄
[MUSIC] The Ballad of LoyceV
babo (OP)
Legendary
*
Offline

Activity: 4480
Merit: 5879


si vis pacem, para bellum


View Profile WWW
Today at 11:43:10 AM
 #12

I haven't tested it, so I'll ask here: does this only include "Depth 0"? It would be very interesting if you can add "Depth 1" and "2" (see my Personal Full Trust Depth viewer).
I keep DefaultTrust on my Trust list, so my Trust settings show even more names I don't recognize on "Depth 2", but even without DefaultTrust, it easily adds many users through "inclusions of inclusions of users on my Trust list".

yes is next iteration

now i put button for show list and fix a bug

in dark theme of fillippone

button for trust list



and trust list



after i start to think how show trust list

GhostOfBitcoin
Member
**
Offline

Activity: 120
Merit: 50

Contact TG: @GOB_CEO


View Profile WWW
Today at 01:57:19 PM
 #13

I haven't tested it, so I'll ask here: does this only include "Depth 0"? It would be very interesting if you can add "Depth 1" and "2" (see my Personal Full Trust Depth viewer).
I keep DefaultTrust on my Trust list, so my Trust settings show even more names I don't recognize on "Depth 2", but even without DefaultTrust, it easily adds many users through "inclusions of inclusions of users on my Trust list".

yes is next iteration

now i put button for show list and fix a bug

in dark theme of fillippone

button for trust list



and trust list



after i start to think how show trust list
I really like the Trust List button!

However, I'd like to suggest one small improvement: you could add the Trust List icon next to the Trusted label. Clicking the icon could display the complete Trust List. I think this would make the feature even more convenient and user friendly. If you like the idea, you can consider it.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!