Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# Sometimes a user will realize they've been accidentally tooting with the wrong privay setting in a specific browswer or app, and they meant their posts to be private. This script does that.
# Hey, uh, admins? Don't do this, unless you *really* trust the user. Changing status privacy after the fact can be abused. See:
# Open a rails console.
ids = %w( PASTE_IDS_LIST )
statuses = { |i| Status.find(i) }
statuses.reject { |s| s.uri.include? "USERNAME" } # Check that all the statuses belong to the user
statuses.first.uri # Open in an incognito browser
statuses.first.update_attributes!(visibility: :private) # Test one status change
# Refresh browser, verify this worked. { |s| s.update_attributes!(visibility: :private) }.uniq # Do them all. { |i| Status.find(i) }.select { |s| s.visibility != "private" } # Verify this is empty.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment