Skip to content

Instantly share code, notes, and snippets.

@hideyukisaito
Created March 30, 2014 13:32
Show Gist options
  • Save hideyukisaito/9872897 to your computer and use it in GitHub Desktop.
Save hideyukisaito/9872897 to your computer and use it in GitHub Desktop.
Facebook から友人のプロフィール画像をぶっこぬく
#encoding: utf-8
require 'rubygems'
require 'open-uri'
require 'koala'
access_token = 'my_holy_token'
@graph = Koala::Facebook::API.new(access_token)
ids = @graph.get_connections('me', 'friends').map { |f| f['id'] }
ids.each do |id|
open("#{id}.jpg", 'wb') do |f|
f.write(open("https://graph.facebook.com/#{id}/picture?type=large").read)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment