-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsponsors-to-brella.js
64 lines (60 loc) · 1.37 KB
/
sponsors-to-brella.js
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
const {
data: {
conference: { partners, goldSponsors, silverSponsors, bronzeSponsors },
},
} = require("./2021-sponsors.json");
const rows = generateRows("Partners", partners)
.concat(generateRows("Gold", goldSponsors))
.concat(generateRows("Silver", silverSponsors))
.concat(generateRows("Bronze", bronzeSponsors));
console.log(
"Id,External Id,Name,Category,Subtitle,Enable Chat,Website,Facebook,Twitter,Linkedin,Content,Logo,Media type,Media title,Media URL"
);
rows.forEach(
({
id,
external_id,
name,
category,
subtitle,
enableChat,
website,
facebook,
twitter,
linkedin,
content,
logo,
mediaType,
mediaTitle,
mediaURL,
}) =>
console.log(
`${id},${external_id},${name},${category},${subtitle},${enableChat},${website},${facebook},${twitter},${linkedin},${content},${logo},${mediaType},${mediaTitle},${mediaURL}`
)
);
function generateRows(category, data) {
return data.map(
({
name,
social: { homepage, twitter, facebook, linkedin },
about,
image: { url },
}) => ({
id: "",
external_id: "",
name,
category,
subtitle: "",
enableChat: "FALSE",
website: homepage,
facebook,
twitter,
linkedin,
content: about,
logo: url,
mediaType: "",
mediaTitle: "",
mediaURL: "",
})
);
}