Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 16 lines (12 sloc) 0.504 kb
b74a2ed init
Julio Capote authored
1 require 'rubygems'
2 require 'rest_client'
3 require 'json'
4
5 puts "creating channel..."
6 resp = RestClient.post 'http://localhost:4567/channels', :data => ''
7 id = JSON.parse(resp)["id"]
8
9 puts "adding subscriber to channel #{id}"
125707e pull from zh
Julio Capote authored
10 resp = RestClient.post 'http://localhost:4567/subscribers', :data => { :channel => id, :url => ARGV[0] }.to_json
b74a2ed init
Julio Capote authored
11 puts resp
12
13 puts "posting message to #{id}"
125707e pull from zh
Julio Capote authored
14 resp = RestClient.post 'http://localhost:4567/messages', :data => { :channel => id, :message => 'HAYYY' }.to_json
b74a2ed init
Julio Capote authored
15 puts resp
Something went wrong with that request. Please try again.