Created
August 31, 2010 07:15
-
-
Save tekin/558672 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
# 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