Skip to content

Instantly share code, notes, and snippets.

@nightpool
Last active June 15, 2019 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nightpool/7626202da05ec2f301850d0f5b343cce to your computer and use it in GitHub Desktop.
Save nightpool/7626202da05ec2f301850d0f5b343cce to your computer and use it in GitHub Desktop.
get rid of the spammers (once you've added a patch to prevent them from coming back, i hope!)
# find recent statuses linking to womenarestupid.site
spam_statuses = Status.where("id > 102230000000000000").where("text ilike '%https://womenarestupid.site%'").includes(:account)
# filter out accounts that have any local followers (almost certainly false positives)
spam_accounts = spam_statuses.map(&:account).uniq.select { |i| i.followers.local.count == 0 }
# double check their usernames to make sure
# (you can replace :acct with :uri if you want to look at their profiles)
puts spam_accounts.map(&:acct)
# when you're ready, run the next line below (commented so people don't run it on accident)
# spam_accounts.each { |i| Admin::SuspensionWorker.perform_async(i.id) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment