Skip to content

Instantly share code, notes, and snippets.

@yankov
Created August 3, 2011 21:41
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 yankov/1123852 to your computer and use it in GitHub Desktop.
Save yankov/1123852 to your computer and use it in GitHub Desktop.
Sending message to faye server from ruby
def notify(message)
msg = JSON.dump('channel' => "/notifications/channel", 'data' => {'text' => message})
uri = URI.parse('http://127.0.0.1:3333/faye')
Net::HTTP.post_form(uri, :message => msg)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment