Skip to content

Instantly share code, notes, and snippets.

@marcwickenden
Created November 21, 2013 19:02
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 marcwickenden/7587555 to your computer and use it in GitHub Desktop.
Save marcwickenden/7587555 to your computer and use it in GitHub Desktop.
Automatically follow the @Marble_Security top-100-security-experts list members. If that's useful to you! You'll need to supply valid OAuth credentials from dev.twitter.com (read-write). You also need the twitter gem installed: gem install twitter Then just ruby 100sec.rb
#!/usr/bin/env ruby
require 'twitter'
Twitter.configure do |config|
config.consumer_key = "<your consumer key>"
config.consumer_secret = "<your consumer secret>"
config.oauth_token = "<your oauth token>"
config.oauth_token_secret = "<your oauth token secret>"
end
client = Twitter::Client.new
list = client.list('Marble_Security', 'top-100-security-experts')
members = client.list_members(list.id)
until members.next_cursor == 0
members.users.each do |user|
puts "following #{user.screen_name}"
client.follow(user.screen_name)
end
members = client.list_members(list.id, { :cursor => members.next_cursor })
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment