-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.rb
More file actions
28 lines (20 loc) · 672 Bytes
/
test.rb
File metadata and controls
28 lines (20 loc) · 672 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# encoding: utf-8
require './starchatapiclient'
require 'yaml'
setting = YAML.load_file('./config.yaml')
test_channel = setting['test_channel']
s = StarChatApiClient.new(setting['host'], setting['username'], setting['password'])
p "=== get_user ==="
p s.get_user()
p "=== get_channels / get_channel / get_users ==="
channels = s.get_channels()
channels.each do |channel|
p s.get_channel(channel['name'])
p s.get_users(channel['name'])
end
p "=== subscribe_channel ==="
s.subscribe_channel(test_channel)
p "=== post_comment ==="
s.post_comment(test_channel, "コメントcomment\n1234567890")
p "=== unsubscribe_channel ==="
s.unsubscribe_channel(test_channel)