-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.txt
More file actions
91 lines (87 loc) · 2.7 KB
/
test.txt
File metadata and controls
91 lines (87 loc) · 2.7 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Update $baseUrl and $auth if needed
$baseUrl = 'https://blue2-245bf-default-rtdb.firebaseio.com'
$auth = '' # set like '?auth=YOUR_ID_TOKEN' if required
function NowMs { [int64]((Get-Date).ToUniversalTime() - [datetime]'1970-01-01').TotalMilliseconds }
$cios = @(
@{
name = 'Chess Club'
pfp = 'https://placecats.com/200/200'
description = 'Casual & competitive chess meetups every week.'
public = $true
createdAt = NowMs
members = @{
'uid_admin_1' = @{ role = 'admin'; joinedAt = NowMs }
'uid_user_2' = @{ role = 'member'; joinedAt = NowMs }
}
events = @{ 'event_chess_1' = $true }
announcements = @{
'ann_1' = @{
postedAt = NowMs
description = 'Welcome to the new semester! First meetup Friday.'
media = @{ type = 'image'; url = 'https://placecats.com/600/400' }
}
}
banned = @{}
}
@{
name = 'Robotics Society'
pfp = 'https://placecats.com/201/201'
description = 'Build robots and compete in challenges.'
public = $false
createdAt = NowMs
members = @{
'uid_admin_3' = @{ role = 'admin'; joinedAt = NowMs }
'uid_user_4' = @{ role = 'member'; joinedAt = NowMs }
}
events = @{ 'event_rob_1' = $true; 'event_rob_2' = $true }
announcements = @{}
banned = @{
'uid_bad_1' = @{ reason = 'Violation'; bannedAt = NowMs }
}
}
@{
name = 'Environmental Club'
pfp = 'https://picsum.photos/202/202'
description = 'Community projects and campus cleanups.'
public = $true
createdAt = NowMs
members = @{
'uid_user_5' = @{ role = 'member'; joinedAt = NowMs }
}
events = @{ 'event_env_1' = $true }
announcements = @{
'ann_2' = @{
postedAt = NowMs
description = 'Tree planting this Saturday. Meet at 9am.'
media = @{ type = 'image'; url = 'https://placecats.com/603/402' }
}
}
banned = @{}
}
@{
name = 'Drama Troupe'
pfp = 'https://placecats.com/203/203'
description = 'Acting workshops and seasonal productions.'
public = $false
createdAt = NowMs
members = @{
'uid_admin_6' = @{ role = 'admin'; joinedAt = NowMs }
'uid_user_7' = @{ role = 'member'; joinedAt = NowMs }
}
events = @{}
announcements = @{
'ann_3' = @{
postedAt = NowMs
description = 'Auditions next week — prepare a one-minute monologue.'
media = @{ type = 'none'; url = '' }
}
}
banned = @{}
}
)
foreach ($cio in $cios) {
$json = $cio | ConvertTo-Json -Depth 8
$resp = Invoke-RestMethod -Uri ("{0}/cios.json{1}" -f $baseUrl, $auth) -Method Post -Body $json -ContentType 'application/json'
Write-Output "Created CIO id: $($resp.name)"
}
# commit overwrite