-
Notifications
You must be signed in to change notification settings - Fork 0
/
add_lots_o_books.rb
45 lines (44 loc) · 1.35 KB
/
add_lots_o_books.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
require './local_sequel'
titles = <<END.split("\n")
Deep Bridge
The Last Force
Gate of Soul
The Rainbow's Touch
The Door of the Time
Years in th Scent
Bare Door
The Wild Soul
Dreamer of Legacy
The Alien's Wizard
The Witch of the Shores
Person in the Danger
END
if (storybot = User.from_name('StoryBot')).nil?
storybot = User.create(user: "StoryBot",
pass: "*", #makes sure noone can login
email:"[email protected]",
emailver: "wsdfdgiueamfdwoieaihF67ewia",
veri: true,
hist: makearray)
end
titles.each do |title|
nameid = DB[:names].insert(auth: storybot.id,
name: title,
upvotes: makearray,
downvotes: makearray)
b = Book.create(auth: storybot,
name: nameid,
chaps: makearray,
endvotes: makearray,
noendvotes: makearray,
pparas: makearray,
pnames: makearray,)
c1 = Chap.create(name: "Chapter 1")
p = Para.create(auth: storybot,
an: '',
text: "Once upon a time...",
upvotes: makearray,
downvotes: makearray)
c1.paras << p
b.chaps << c1
end