Sha256: fc85a7cf425a75f3ac2b141f8d6d756a1927fbe21b473a42524a3a28ba64a541

Contents?: true

Size: 761 Bytes

Versions: 8

Compression:

Stored size: 761 Bytes

Contents

require 'rubygems'
require 'protolink'

protonet   = Protolink::Protonet.open('http://localhost:3000', 'bjoern.dorra', 'geheim')

user       = protonet.find_or_create_user_by_login("johndoe", :password => "password", :name => "John Doe", :email => "john@doe.com")
auth_token = user.auth_token
puts       "user_id     : #{user.id}"
puts       "user_login  : #{user.login}"
puts       "auth_token  : #{auth_token}"

channel    = protonet.find_or_create_channel_by_name("test", :description => "This is a test channel!")
puts       "channel_id  : #{channel.id}"
puts       "channel_name: #{channel.name}"
puts       "channel_desc: #{channel.description}"

protonet.create_listen(user.id, channel.id)

puts       "\nhttp://localhost:3000/?auth_token=#{auth_token}"

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
protolink-0.2.7 example/create_and_subscribe.rb
protolink-0.2.6 example/create_and_subscribe.rb
protolink-0.2.5 example/create_and_subscribe.rb
protolink-0.2.4 example/create_and_subscribe.rb
protolink-0.2.3 example/create_and_subscribe.rb
protolink-0.2.2 example/create_and_subscribe.rb
protolink-0.2.1 example/create_and_subscribe.rb
protolink-0.2.0 example/create_and_subscribe.rb