Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #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')
Advertisement
Add Comment
Please, Sign In to add comment