Created
February 27, 2020 15:40
-
-
Save Phlip/fb97b629045db90cda2af4ca9353b3ca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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