public
Created

Non-working mtgox socket.io ruby code

  • Download Gist
gistfile1.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
require 'rubygems'
require 'socketIO'
 
client = SocketIO.connect("https://socketio.mtgox.com/mtgox") do
before_start do |f|
on_disconnect { p "disconnected"}
on_connect { p "connected" }
on_heartbeat { p "."}
on_message { |msg| p msg }
on_json_message { |json| p json}
on_ack { p "ack"}
on_error { |data| p data }
on_noop { p "noop"}
end
on_event("message") do |e|
p e
end
after_start do
emit("op: subscribe", "channel: dbf1dee9-4f2e-4a08-8cb7-748919a71b21")
emit("op: subscribe", "channel: d5f06780-30a8-4a48-a2f8-7ed181b4a13f")
end
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.