Skip to content

Instantly share code, notes, and snippets.

@Phlip
Created February 27, 2020 15:40
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 Phlip/fb97b629045db90cda2af4ca9353b3ca to your computer and use it in GitHub Desktop.
Save Phlip/fb97b629045db90cda2af4ca9353b3ca to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'twitter'
# Read https://developer.twitter.com/en/apps/3851951 to get the access
# keys for your Twitter account
client = Twitter::REST::Client.new do |config|
config.consumer_key = "secret"
config.consumer_secret = "secret"
config.access_token = "secret"
config.access_token_secret = "secret"
end
user = client.user('TwitterHandle')
following_ids = client.friend_ids(user).to_a
follower_ids = client.follower_ids(user).to_a
leader_ids = (following_ids - follower_ids)
puts "number of guests: #{leader_ids.length}"
leader_ids.shuffle.each do |leader_id|
leader = client.user(leader_id)
if ! true_leaders.include?(leader.screen_name)
p [leader.name, leader.screen_name]
puts leader.description
response = gets.chomp
if response == 'y'
`konqueror https://twitter.com/#{leader.screen_name} &`
end
if response == 'u'
client.unfollow(leader_id)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment