Bitcoin Forum
October 15, 2026, 02:24:30 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 307 times)
babo (OP)
Legendary
*
Offline

Activity: 4494
Merit: 5879


si vis pacem, para bellum


View Profile WWW
October 13, 2026, 12:57:31 PM
Last edit: October 14, 2026, 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: 4494
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: 2134


฿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: 257
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: 4494
Merit: 5879


si vis pacem, para bellum


View Profile WWW
October 14, 2026, 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: 156
Merit: 109


View Profile
October 14, 2026, 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
October 14, 2026, 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: 4494
Merit: 5879


si vis pacem, para bellum


View Profile WWW
October 14, 2026, 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: 4200
Merit: 22964


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
October 14, 2026, 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: 4494
Merit: 5879


si vis pacem, para bellum


View Profile WWW
October 14, 2026, 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
October 14, 2026, 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.
babo (OP)
Legendary
*
Offline

Activity: 4494
Merit: 5879


si vis pacem, para bellum


View Profile WWW
Today at 08:43:42 AM
 #14

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".

ok u mean like this

https://loyce.club/trust/depth/65636.html

ok ok
If you leave the service always active I can go fishing there up to depth 1, depth 2 seems a bit too much to me... you would like to display DT2 in practice if I'm not mistaken
I can scrape it and put it in local storage as a cache to not slow down your site and therefore display DT1 green (trusted) or DT1 red (untrusted)

atookz
Full Member
***
Online Online

Activity: 606
Merit: 193


AntiSwap.io - NO AML/KYC EXCHANGER MONITORING


View Profile
Today at 10:59:54 AM
Merited by babo (1)
 #15

Nice idea, @babo. I scanned through the code and saw that fetchTrustList() is called on every page load, even when the cache is still valid, so the cache does not actually reduce the number of requests for the first access to the page, but not decrease when the cache is still valid. It is important now because you will be scraping loyce.club, and the the last thing you want is to put too much load on LoyceV's server. Also, the HTML decoding only handles &amp;, &lt; and &gt;, so usernames containing quotes might not match. Rather minor issues, and I may be wrong, I have only read the code and haven't tested it yet. I'll see how it goes later. Thank you for the script!

LoyceV
Legendary
*
Offline

Activity: 4200
Merit: 22964


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
Today at 11:20:47 AM
 #16

If you leave the service always active I can go fishing there up to depth 1, depth 2 seems a bit too much to me... you would like to display DT2 in practice if I'm not mistaken
My Trust Depth site doesn't get regular updates, the last update was in December. So I wouldn't use it.
Depth 2 is what the forum uses by default, so feedback from anyone on your Depth 2 shows up for you. I expect you'll be surprised by how many users pop up.
The forum itself also shows this on the Trust page, and that's up-to-date if you want to scrape it, but it includes DefaultTrust (if included).

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

Activity: 4494
Merit: 5879


si vis pacem, para bellum


View Profile WWW
Today at 12:07:15 PM
Last edit: Today at 01:07:51 PM by babo
 #17

If you leave the service always active I can go fishing there up to depth 1, depth 2 seems a bit too much to me... you would like to display DT2 in practice if I'm not mistaken
My Trust Depth site doesn't get regular updates, the last update was in December. So I wouldn't use it.
Depth 2 is what the forum uses by default, so feedback from anyone on your Depth 2 shows up for you. I expect you'll be surprised by how many users pop up.
The forum itself also shows this on the Trust page, and that's up-to-date if you want to scrape it, but it includes DefaultTrust (if included).


aaaah ok
I can take them from the page, there are no problems... they are already there and then put them in the cache
I have to review the cache and see if, as the guys say, it also calls the page with the hit (I don't like this thing and I have to fix it, given that the 1 day cache is sufficient, maybe even more than 1 day)
I should be able to work on it tomorrow

LoyceV
Legendary
*
Offline

Activity: 4200
Merit: 22964


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
Today at 01:00:47 PM
Merited by babo (1)
 #18

aaaah ok
posso prenderli dalla pagina non ci sono problemi .. tanto ci sono gia e poi metterli in cache
devo rivedere la cache e capire se come dicono i ragazzi anche con la hit chiama la pagina (questa cosa non mi piace e la devo sistemare, dato che la cache di 1 giorno e' sufficiente forse anche piu di 1 giorno)
domani dovrei poterci lavorare
Lol @Spaghetti language Tongue

¡uʍop ǝpᴉsdn pɐǝɥ ɹnoʎ ɥʇᴉʍ ʎuunɟ ʞool no⅄
[MUSIC] The Ballad of LoyceV
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!