codemasher/terfblocker5000

Twitter TERF 滤器。PHP 7.4+

dev-main 2022-08-10 12:17 UTC

This package is auto-updated.

Last update: 2024-09-10 16:41:08 UTC


README

通过大量拦截 TERF 等方式来改善您的 Twitter 体验。

TERF - Trans Exclusionary Radical "Feminists" - 是一个相当令人讨厌的现象,主要是(但不仅限于)英国现象,正如 Judith Butler 所说的,这是一个 法西斯 趋势。他们假装“为妇女和女孩的权利而战”,但实际上他们散播关于跨性别者的仇恨和错误信息。他们来自不同的口味,从“担忧的母亲”到 恐怖分子,并且——就像他们的 右翼朋友 一样——他们使用了大量的 狗哨,这就是 TERFBLOCKER5000 走进来发挥作用的地方。

TERFBLOCKER5000 会扫描用户资料(显示名称、简介和位置),并将它们与一个 单词列表 进行筛选。当然,它并不完美,但它捕捉到了大多数最仇恨的账户(在测试环境中扫描了 180 万个账户中的大约 2%——尝尝 Vogon 诗歌的滋味)。

PHP Version Support version license

文档(进行中)

// @see https://github.com/chillerlan/php-oauth-providers/blob/main/examples/get-token/Twitter.php
$token    = (new AccessToken)->fromJSON(file_get_contents($CFGDIR.'/Twitter.token.json'));
$wordlist = require $CFGDIR.'/wordlist.php';

$terfblocker
	// import a new twitter oauth token if needed
	->importUserToken($token)
	// set the list of terms to match against (required)
	->setWordlist($wordlist)
	// fetch from replies to a given tweet
	// the 2nd parameter toggles the API request limit enforcement
	->fromMentions('https://twitter.com/Nigella_Lawson/status/1441121776780464132', true)
	// or just the @-mentions of a user
	->fromMentions('https://twitter.com/Lenniesaurus', true)
	// from an advanced search
	// @see https://developer.twitter.com/en/docs/twitter-api/v1/tweets/search/guides/standard-operators
	->fromSearch('#IStandWithJKRowling', true)
	// from the followers of the given account
	->fromFollowers('https://twitter.com/HJoyceGender', true)
	// from the accounts the given account follows
	->fromFollowing('https://twitter.com/HJoyceGender', true)
	// from followers AND following from a list of screen names ()
	->fromFollowersAndFollowing(['ALLIANCELGB', 'Transgendertrd', 'fairplaywomen'], true)
	// adds each of the given screen_names to the given block list (always, block, never)
	->fromScreenNames(['ALLIANCELGB', 'Transgendertrd', 'fairplaywomen'], 'always')
	// fetches the retweeters of the given tweet - note that the results of this endpoint
	// may not return *all* but only the *recent* retweeters - whatever that means...
	->fromRetweets('https://twitter.com/fairplaywomen/status/1388442839969931264')
	// fetches all users of the given (private) list
	->fromList('TERFBLOCKER5000', 'always')
	// adds the user IDs from the block list of the currently authenticated user to the profile table
	->fromBlocklist()
	// add user IDs found in the given JSON file
	->fromJSON(__DIR__.'/users.json')
	// exports the block list from the database into a JSON file in the given path
	->exportBlocklist(__DIR__.'/../json/')
;

/**
 * cron methods
 */
 
$terfblocker
	// adds a list of screen names to the "scan jobs" table
	->cronAddScreenNames(['ALLIANCELGB', 'Transgendertrd', 'fairplaywomen'])
	// scans followers/following for users in the scan jobs table, @see /cron/fetch_follow.php
	->cronScanFollow();

// the profile fetcher @see /cron/fetch_profiles.php
$terfblocker->cronFetchProfiles();

// rescans the profile table against the given wordlist
$terfblocker
	->setWordlist($wordlist)
	->cronScanByWordlist();
	
// performs blocks for the currently authenticated user, @see /cron/perform_block.php
$terfblocker->block();

QR codes are awesome!