Created
January 12, 2015 17:20
-
-
Save sbauch/4a272c11644e3943438b to your computer and use it in GitHub Desktop.
Twitter List => Custom Audience
This file contains 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' | |
require 'csv' | |
handle = ARGV[0] | |
list = ARGV[1] | |
client = Twitter::REST::Client.new do |config| | |
config.consumer_key = "YOUR KEY" | |
config.consumer_secret = "YOUR SECRET" | |
config.access_token = "YOUR ACCESS TOKEN" | |
config.access_token_secret = "YOUR ACCESS TOKEN SECRET" | |
end | |
list = client.list_members(handle, list, {:limit => 5000}) | |
CSV.open("audience.csv", "w") do |csv| | |
list.each do |u| | |
csv << [u.id.to_s, u.name] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment