Ok, so I played around and figured out how to post photos.
I mainly used the open-uri library to convert image links to file objects, which can then be uploaded to UploadableIO and uploaded to Facebook. This is the code that worked:
require 'open-uri' OpenURI::Buffer.send :remove_const, 'StringMax' if OpenURI::Buffer.const_defined?('StringMax') OpenURI::Buffer.const_set 'StringMax', 0 picture = Koala::UploadableIO.new(open(@event.photo.url(:small)).path, 'image') params = { picture: picture, name: @event.name, description: @event.description, location: @event.location, start_time: datetime } @graph.put_object('me', 'events', params )
The OpenURI StringMax constant needed to be changed, because the image files I used were small enough for the files to be processed as strings, not file objects.
Hope this helps anyone trying to fix it!
source share