Skip to content

Instantly share code, notes, and snippets.

@ferblape
Created July 24, 2020 08:53
Show Gist options
  • Save ferblape/f6bec9fc1f135d47807c5064c708f642 to your computer and use it in GitHub Desktop.
Save ferblape/f6bec9fc1f135d47807c5064c708f642 to your computer and use it in GitHub Desktop.
Disable all your contact retweets
require "twitter"
# 1. Go to https://developer.twitter.com/en/apps
# 2. Create a new app with write permission
# 3. Copy and paste the tokens
API_KEY = ""
API_SECRET = ""
ACCESS_TOKEN = ""
ACCESS_TOKEN_SECRET = ""
client = Twitter::REST::Client.new do |config|
config.consumer_key = API_KEY
config.consumer_secret = API_SECRET
config.access_token = ACCESS_TOKEN
config.access_token_secret = ACCESS_TOKEN_SECRET
end
client.friend_ids.each do |id|
client.friendship_update(id, device: false, retweets: false)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment