I collected a large number of Twitter usernames recently from conference websites (tryin’ to bone up on a new topic) and wanted to put them all into a new list. No UI? No problem! To the Twitter API we go…
Create a list. Note its URL slug (its string representation in the URL).
After it’s created, go to “Settings”, scroll down, and change its access to “Read and Write”:
Note the consumer key and consumer secret.
Install twurl. It’s like curl, but for Twitter:
$ gem install twurl
$ twurl authorize --consumer-key your-key-goes-here \ --consumer-secret your-somewhat-longer-secret-goes-here
Copy and visit the link it gives you, then paste the PIN code back into the console.
Add the screen names to the list.
Replace the list slug, your screen name, and the comma separated list of screen names that will go into the list with your own values:
$ twurl -X POST -d "slug=sweet-songs&owner_screen_name=jayunit&screen_name=donkeysong,brian,gabe5000" /1/lists/members/create_all.json
And you’re done! Go check out your list.
This could be wrapped up into a Twitter-authed app, which I’ll leave as an exercise.