-
-
Save anonymous/7364ab24072d3ee947d2 to your computer and use it in GitHub Desktop.
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
#for Errno::ENOENT at / | |
#No such file or directory - ["https://scontent.xx.fbcdn.net/hprofile-xpa1/v/t1.0-1/p720x720/12096589_1495421344087950_7262794375923311339_n.jpg?oh=e30bafeb3343f37e1ff4b043a1d9e40a&oe=570956A5"] | |
#file: open-uri.rb location: initialize line: 35 | |
@graph = Koala::Facebook::API.new(session['access_token']) | |
idofme = @graph.get_object("me") { |data| data['id'] } | |
#produces Errno::ENOENT error | |
imgofme = "http://graph.facebook.com/#{idofme}/picture?width=500" | |
httpc = HTTPClient.new | |
resp = httpc.get(imgofme) | |
imgofme2= resp.header['Location'].to_s | |
download = open(imgofme2) | |
IO.copy_stream(download, './temp.png') | |
#but this works | |
#imgofme3="https://scontent.xx.fbcdn.net/hprofile-xpa1/v/t1.0-1/p720x720/12096589_1495421344087950_7262794375923311339_n.jpg?oh=e30bafeb3343f37e1ff4b043a1d9e40a&oe=570956A5" | |
#download = open(imgofme3) | |
#IO.copy_stream(download, './temp.png') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment