Fediverse Block & Spam Reporting
11/11/2022 12:20 pm | : 4 mins. | Share to:
I am now, fairly regularly, keeping an eye on my Fediverse's local timeline. I've taken it as a mission to report spammers I see in that timeline. I am primarily doing this on the desktop while working or relaxing. However, my frustration with their system is that in the neverending spam wars, the anti-spam tools need to be as optimized as possible. And the current process requires far too many clicks.
So, yesterday, I coded a bookmarklet. I tried embedding it, but the JS code doesn't play well with Markdown, so it just rendered the ugly text.
To use this, you just need to copy the below text and then create a bookmark in your browser, give it a name (I used 'Fed Spam') and then paste this code. I haven't done extensive testing, but it works in Firefox flawlessly.
javascript:var%20%24jscomp%3D%24jscomp%7C%7C%7B%7D%3B%24jscomp.scope%3D%7B%7D%3B%24jscomp.arrayIteratorImpl%3Dfunction(a)%7Bvar%20b%3D0%3Breturn%20function()%7Breturn%20b%3Ca.length%3F%7Bdone%3A!1%2Cvalue%3Aa%5Bb%2B%2B%5D%7D%3A%7Bdone%3A!0%7D%7D%7D%3B%24jscomp.arrayIterator%3Dfunction(a)%7Breturn%7Bnext%3A%24jscomp.arrayIteratorImpl(a)%7D%7D%3B%24jscomp.makeIterator%3Dfunction(a)%7Bvar%20b%3D%22undefined%22!%3Dtypeof%20Symbol%26%26Symbol.iterator%26%26a%5BSymbol.iterator%5D%3Breturn%20b%3Fb.call(a)%3A%24jscomp.arrayIterator(a)%7D%3Bdocument.getElementsByClassName(%22setting-text%22)%5B0%5D.value%3D%22spam%22%3Bfor(var%20boxes%3Ddocument.querySelectorAll(%22.status-check-box%20div.react-toggle%22)%2C%24jscomp%24iter%240%3D%24jscomp.makeIterator(boxes)%2C%24jscomp%24key%24box%3D%24jscomp%24iter%240.next()%3B!%24jscomp%24key%24box.done%3B%24jscomp%24key%24box%3D%24jscomp%24iter%240.next())box%3D%24jscomp%24key%24box.value%2Cbox.classList.add(%22react-toggle--checked%22)%3Bvoid+0
The above bookmarklet fills out the "Block & Spam" report form on the Tweetdeck-esque interface for Mastodon. It writes 'Spam' in the message box, and then toggles next to every post. Because I'm reporting bot accounts which are just posting spam every time, I don't need to apply any mental effort of reviewing posts. I'm still clicking the submit button, I didn't add that to the automation (yet?) but it's definitely made it a farcry easier to fight spam on the server.