Created
July 14, 2013 15:11
-
-
Save k0kubun/5994568 to your computer and use it in GitHub Desktop.
screen_nameいれてtwitterのリストに追加するやつ
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 'twitter' | |
Twitter.configure do |config| | |
config.consumer_key = '' | |
config.consumer_secret = '' | |
config.oauth_token = '' | |
config.oauth_token_secret = '' | |
end | |
print "Input list name: " | |
list_name = STDIN.gets.chomp | |
list_id = 0 | |
begin | |
list_id = Twitter.list(list_name).id | |
puts "List id: #{list_id}" | |
rescue | |
puts "[Error] Invalid List Name" | |
exit | |
end | |
loop do | |
print "\nInput screen_name to add: " | |
screen_name = STDIN.gets.chomp | |
begin | |
Twitter.list_add_member(list_id, screen_name) | |
puts "Added #{screen_name}" | |
rescue | |
puts "[Error] Failed to add" | |
exit | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment