Skip to content

Instantly share code, notes, and snippets.

@tekin
Created August 31, 2010 07:15
Show Gist options
  • Save tekin/558672 to your computer and use it in GitHub Desktop.
Save tekin/558672 to your computer and use it in GitHub Desktop.
# install the facebook_api gem first
require 'rubygems'
require 'facebook_api'
FacebookApi.configure do |config|
config.api_key = 'API_KEY_HERE'
config.secret_key = 'SECRET_KEY_HERE'
end
event_info = {:name => 'Event name', :start_time => Time.now.to_i}.to_json
session = FacebookApi::Session.new('SESSION_KEY_HERE', 'UID_HERE')
eid = session.call('Events.create', {:event_info => event_info, :session_key => 'SESSION_KEY_HERE'}, File.new('/path/to/image.jpg'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment