Created
August 3, 2011 21:41
-
-
Save yankov/1123852 to your computer and use it in GitHub Desktop.
Sending message to faye server from ruby
This file contains hidden or 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
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