Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 15 lines (12 sloc) 0.504 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
require 'rubygems'
require 'rest_client'
require 'json'

puts "creating channel..."
resp = RestClient.post 'http://localhost:4567/channels', :data => ''
id = JSON.parse(resp)["id"]

puts "adding subscriber to channel #{id}"
resp = RestClient.post 'http://localhost:4567/subscribers', :data => { :channel => id, :url => ARGV[0] }.to_json
puts resp

puts "posting message to #{id}"
resp = RestClient.post 'http://localhost:4567/messages', :data => { :channel => id, :message => 'HAYYY' }.to_json
puts resp
Something went wrong with that request. Please try again.