Created
April 6, 2013 16:52
-
-
Save robinsloan/5326770 to your computer and use it in GitHub Desktop.
Export IDs of the people you're following on Twitter.
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'twitter' | |
require 'json' | |
require 'faraday' | |
TWITTER_USER = "blahblah" | |
# get these from dev.twitter.com | |
CONSUMER_KEY = "blahblah" | |
CONSUMER_SECRET = "blahblah" | |
OAUTH_TOKEN = "blahblah" | |
OAUTH_TOKEN_SECRET = "blahblah" | |
Twitter.configure do |config| | |
config.consumer_key = CONSUMER_KEY | |
config.consumer_secret = CONSUMER_SECRET | |
config.oauth_token = OAUTH_TOKEN | |
config.oauth_token_secret = OAUTH_TOKEN_SECRET | |
end | |
cursor = -1 | |
followings = Twitter.friend_ids(TWITTER_USER,{:cursor=>cursor}) | |
File.open("followings-#{Time.now.to_s.gsub(" ","_")}.txt", 'w') do |f| | |
f.write followings.ids.to_s | |
end | |
puts "ok! saved #{followings.ids.length} followings to file in this directory." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment