Greasy Fork is available in English.

討論 » 建立請求

A Script that filters blue checkmark replies under twitter tweets

§
發表於:2023-04-22
編輯:2023-04-22

Hi Script Wizards

For some time now Twitter blue subscribers replies under tweets are put on the top of every tweet while non subscribers there replies are obscured into the nothingness. I would love to read some replies from people that don't have the tick. But i have to go trough a sea of verified replies before i can read them. I'm sick and tired of these blue check-marks being on top under every tweet and would love being able to filter them out.

Is there a Wizard that could make this possible?

§
發表於:2023-04-23
編輯:2023-04-23

This should work:

// @match *://twitter.com/*/status/*

Array.from(document.querySelectorAll('div[data-testid="cellInnerDiv"]')).forEach((a) => a.children.item(0).children.item(0)?.querySelector('svg[aria-label="Verified account"]') ? a.parentElement.removeChild(a) : null);
§
發表於:2023-04-23

That code does exactly what you asked, however, actually removing verified tweets isn't possible because:
1. Twitter loads tweets. This means, after you've removed a batch of tweets when you scroll down, more will come.
2. Twitter checks to see if tweets are removed, and if so it'll remove all tweets and ask you to reload: "Something went wrong".

§
發表於:2023-04-27

This should work:

// @match *://twitter.com/*/status/*

Array.from(document.querySelectorAll('div[data-testid="cellInnerDiv"]')).forEach((a) => a.children.item(0).children.item(0)?.querySelector('svg[aria-label="Verified account"]') ? a.parentElement.removeChild(a) : null);

Omg. Sorry for the late reply. Thank you for taking the time to create this script. I trying to figure out to make this work, but i think i'm doing something wrong. I created a new script in Greasemonkey (firefox) and i copied the text into it and saved it. But it doesn't seem to work. Any suggestions?

NotYou管理員
§
發表於:2023-04-27

@Kingkong050, Einstein is jealous of you.

// ==UserScript==
// @name Filter Blue Checkmark Replies
// @version 1.0.0
// @description filter blue checkmark replies under twitter tweets
// @namespace -
// @match *://twitter.com/*/status/*
// @run-at document-idle
// @grant none
// ==/UserScript==

Array.from(document.querySelectorAll('div[data-testid="cellInnerDiv"]')).forEach((a) =>
  a.children.item(0).children.item(0)?.querySelector('svg[aria-label="Verified account"]')
    ? a.parentElement.removeChild(a)
    : null
);
§
發表於:2023-04-27

@Kingkong050, Einstein is jealous of you.

// ==UserScript==
// @name Filter Blue Checkmark Replies
// @version 1.0.0
// @description filter blue checkmark replies under twitter tweets
// @namespace -
// @match *://twitter.com/*/status/*
// @run-at document-idle
// @grant none
// ==/UserScript==

Array.from(document.querySelectorAll('div[data-testid="cellInnerDiv"]')).forEach((a) =>
  a.children.item(0).children.item(0)?.querySelector('svg[aria-label="Verified account"]')
    ? a.parentElement.removeChild(a)
    : null
);

Nice!. But it seem that the script doesn't work. Or im still doing something wrong.

Ty for trying tho.

@Kingkong050, Einstein is jealous of you.

Lies!!
§
發表於:2023-05-13

As I said:


That code does exactly what you asked, however, actually removing verified tweets isn't possible because:
1. Twitter loads tweets. This means, after you've removed a batch of tweets when you scroll down, more will come.
2. Twitter checks to see if tweets are removed, and if so it'll remove all tweets and ask you to reload: "Something went wrong".

Also, that code wouldn't work as a normal user script because tweets aren't displayed as soon as the site opens, instead it loads into place after a couple seconds. So, to fix that you'd use `@run-at context-menu` instead of "document-idle".

But like I said, using the code as a user script is pointless because what you're asking isn't possible.

發表回覆

登入以回復