2023-02-13 12:07:54 +01:00
|
|
|
export async function data(tools) {
|
|
|
|
const $ = await tools.loadHtmlUrl("https://gateway.events/");
|
|
|
|
const out = { speakers: [] };
|
|
|
|
|
|
|
|
const peopleMapper = {
|
2023-02-13 20:12:09 +01:00
|
|
|
'Federico Kunze Küllmer': { country: 'de' },
|
|
|
|
'Sunny Aggarwal': { country: 'tw' },
|
|
|
|
'Zaki Manian': { country: 'us' },
|
|
|
|
'Sergey Gorbunov': { country: 'us' },
|
|
|
|
'Dean Tribble': { country: 'us' },
|
2023-03-15 15:26:33 +01:00
|
|
|
'Sean Braithwaite': { country: 'de' }
|
2023-02-13 12:07:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
for (const el of $("#speakers div.w-full.relative").toArray()) {
|
|
|
|
const value = (path) => cleanup($(path, el).text());
|
|
|
|
const name = value("h3 span")
|
|
|
|
|
|
|
|
const item = {
|
|
|
|
id: tools.formatId(name),
|
|
|
|
name,
|
|
|
|
photoUrl: $("div.group img", el).attr("src"),
|
|
|
|
caption: value("div.text-white"),
|
|
|
|
twitter: $("div.flex a", el).attr("href")?.replace("https://twitter.com/","").replace(/\?lang=\w{2}$/, ''),
|
|
|
|
//linkedin: $$("a.linkedIn", sp).attr("href")?.replace("https://www.linkedin.com/in/","").replace(/\/$/,""),
|
|
|
|
//tag: value(".taxTag "),
|
|
|
|
//country: 'xx',
|
|
|
|
//desc: $$('p', sp).text(),
|
|
|
|
//web: { url: $$(".www", sp).attr("href") },
|
|
|
|
//link
|
|
|
|
}
|
|
|
|
|
|
|
|
if (peopleMapper[name]) {
|
|
|
|
Object.assign(item, peopleMapper[name])
|
|
|
|
}
|
|
|
|
out.speakers.push(item);
|
|
|
|
}
|
2023-02-13 19:59:41 +01:00
|
|
|
//console.log(out)
|
2023-02-13 12:07:54 +01:00
|
|
|
return out;
|
|
|
|
}
|
|
|
|
|
|
|
|
function cleanup(str) {
|
|
|
|
return str.replace(/(\s{2,}|\n)/g, " ").trim();
|
|
|
|
}
|
|
|
|
|