Skip to content

Instantly share code, notes, and snippets.

@joesavak
Created May 20, 2011 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joesavak/983701 to your computer and use it in GitHub Desktop.
Save joesavak/983701 to your computer and use it in GitHub Desktop.
koalapost
begin
@graph = Koala::Facebook::GraphAPI.new(user.fbaccess)
str = "hello fb world"
link = HOSTURL+"/comments/"+id #hostURL is an env variable for us
returnstr = @graph.put_wall_post(str,{:name=>"linkName",:link=>link})
rescue
#eventually we'll have more logic here, but we basically turn it off for now (no more posts if failure)
user.fbaccess = nil
user.fbusername = nil
user.fb_uid = nil
user.save!
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment