/
server.rb
63 lines (40 loc) · 983 Bytes
/
server.rb
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
require 'xmlrpc/client'
#require 'names'
confluence = XMLRPC::Client.new2("http://localhost:8090/rpc/xmlrpc").proxy("confluence2")
token = confluence.login("admin", "admin")
# user = {
# "name" => user_name,
# "fullname" => full_name,
# "email" => email
# }
# confluence.addUser(token, user, user_name)
f = File.open('names.txt')
a = f.readlines
a.each do |names|
page_title = names
page = {
"space" => "SPACE",
"title" => page_title,
"content" => "some conent right here"
}
confluence.storePage(token, page)
end
#puts s
space_name = "Glenn Space"
space_key = "SPACE"
description = "This is glenns space"
space = {
"name" => space_name,
"key" => space_key,
"description" => description
}
#page_title = s.random_element
page_title = "FirstPage2"
page_content = "This is the first page content"
# page = {
# "space" => space_key,
# "title" => page_title,
# "content" => page_content
# }
# confluence.addSpace(token, space)
#confluence.storePage(token, page)