Should be pretty easy to set up:
- Install the
twitter
gem withgem install twitter
(you may have to dosudo gem install twitter
). - Look at the comments in
sn-to-id.rb
for where you'll go to set up an app with Twitter (the URLs they ask for don't matter, in this case). Put in all of the keys, tokens, and secrets. - On line 23, you'll paste in your list of usernames. You are limited to 100 usernames for each time you run the script. And I think you're limited to running the script 60 times an hour. Check the docs on the latter point tho. This is fairly permissive; as long as you have usernames separated by commas, you'll be golden (it doesn't matter if there's a space or not after the commas).
- Create a text file (like above) called
my_users.csv
in the same directory as thesn-to-id.rb
file; putusername,id
as its first line. Every time you run thesn-to-id.rb
script, your new batch of usernames/ids will be appended to the file. NOTE: the script is not smart enough to filter out duplicate usernames, so you'll get duplicate entries if a username is entered more than once. - You might need to run
chmod 744 sn-to-id.rb
on your command line to make sure its executable. - Once you've done all that, on the command line, just run
./sn-to-id.rb
in the directory where it (and themy_users.csv
) lives. After it's run, open upmy_users.csv
in your editor of choice, and you should see a list that looks something like:
username,id
billwolff,2493291
LizaPotts,4406381
karlstolley,16049663