Permalink
Browse files

Add flowdock example.

Signed-off-by: François de Metz <francois@stormz.me>
  • Loading branch information...
1 parent 46dbbbf commit 888ddc8c0d0ce3c689474f9187b7fb3e814dc63b @francois2metz francois2metz committed May 13, 2012
Showing with 22 additions and 0 deletions.
  1. +22 −0 examples/flowdock.rb
View
@@ -0,0 +1,22 @@
+# https://flowdock.com/
+
+
+token = "" # token = your Flowdock access token
+organization = "" # organization = Flowdock subdomain
+flow = "" # flow = name of flow in URL
+
+$: << 'lib' << '../lib'
+
+require 'em-eventsource'
+
+EM.run do
+ source = EM::EventSource.new("https://#{token}:@stream.flowdock.com/flows/#{organization}/#{flow}",
+ {query: 'text/event-stream'},
+ {'Accept' => 'text/event-stream'})
+
+ source.message do |message|
+ puts "new message #{message}"
+ end
+
+ source.start
+end

0 comments on commit 888ddc8

Please sign in to comment.