Skip to content

Instantly share code, notes, and snippets.

@kakutani
Created September 16, 2011 12:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kakutani/1222001 to your computer and use it in GitHub Desktop.
Save kakutani/1222001 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
unless ARGV.size == 1
puts "specify screenname!"
exit 1
end
username = ARGV.shift
url = "http://api.twitter.com/1/users/profile_image/#{username}.json?size=bigger"
require 'open-uri'
img = open(url).read
img_fname = "#{username}.png"
puts "write profile image to #{img_fname}"
File.open(img_fname, 'w'){|f| f.write(img) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment