Skip to content

Add an "only if they contain" filter to delete tweets and retweets - #733

Open
datboip wants to merge 2 commits into
lockdown-systems:mainfrom
datboip:delete-filter-contains
Open

datboip wants to merge 2 commits into
lockdown-systems:mainfrom
datboip:delete-filter-contains

Conversation

@datboip

@datboip datboip commented Oct 17, 2026 •

Copy link
Copy Markdown

I found Cyd really useful, but I didn't need to delete all my posts, only certain ones, and there was no way to limit a delete to those. So I added it.

Under "Delete my tweets" and "Delete my retweets" there's now an optional "only if they contain …" box. Type a word, @user or #hashtag, and the delete is limited to posts containing it.

  • Matches whole words, case-insensitively: coffee finds #coffee but not @CoffeeBot. A * stands for the rest of a word, so coffee* also finds CoffeeBot.
  • The Review count, the live match count on the options page, and the delete itself all use the same match.
  • A ticked filter with no text would match everything, so Continue stays disabled until it's filled in or unticked. More than three * is rejected, since a handful of them against a long word made the match effectively hang.
  • Adds four columns to xAccount (additive migration), with tests for the matcher, the delete and the options page.

The second commit is unrelated: refreshing stats while logged out loaded the X login page with the automation overlay already on, which blocks clicks, so you couldn't log in. Happy to split it into its own PR.

Two decisions for the maintainers

  1. I made the filter a Premium option, like the retweet age filter (xRequiresPremium). If it should be free, that's a small change.
  2. Separate from this PR: the existing "unless they have at least N likes" label says "at least", but the code uses <=, so a tweet with exactly N is deleted.

npm run lint and the tests pass locally, except one database.test.ts migration test that times out when the whole suite runs and passes on its own.

(This was written by an LLM.)

🤖 Generated with Claude Code

datboip and others added 2 commits October 17, 2026 17:38
Refreshing the X stats while logged out loaded the X login page with the
automation notice already on, which blocks clicks in the browser view, so
there was no way to log in and the account was stuck on that screen. Start
with the notice off; login() turns it on itself once login succeeds.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Adds an optional filter under "Delete my tweets" and "Delete my retweets"
so a delete can be limited to posts containing a word, `@user` or `#hashtag`.

- Matching is case-insensitive and on whole words, so "coffee" finds
  "#coffee" but not "CoffeeBot" with an @ in front. A * stands for the rest of a word, so
  "coffee*" also finds "CoffeeBot". Anything else is taken literally.
- SQLite's LIKE can't express word edges, so the match is a function
  registered on the account database. The Review count, the live preview
  on the options page and the delete itself all go through it.
- A ticked filter with no text (or only stars) would match every post, so
  Continue stays disabled until it is filled in or unticked.
- More than three * in a filter is rejected. Each one lets the pattern try
  every split of a word, and five of them against a long word did not finish.
- Review lists the filter with the other conditions, and the Review count
  now reads the settings just saved from the options page.
- The filter is marked as a Premium option, like the retweet age filter.
  That is a product decision and easy to change in xRequiresPremium.
- Adds four nullable-safe columns to xAccount (additive migration).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@datboip
datboip force-pushed the delete-filter-contains branch from 8768500 to 51cf24a Compare October 17, 2026 21:38
@datboip
datboip marked this pull request as ready for review October 17, 2026 23:29

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant