fmt also event sync scripts
This commit is contained in:
rodič
e476cd9643
revize
58254c5cc9
2
Makefile
2
Makefile
|
@ -11,7 +11,7 @@ link-check:
|
|||
lychee spec/**/*.yaml
|
||||
|
||||
format:
|
||||
deno fmt utils/*.js README.md
|
||||
deno fmt utils/*.js data/*/events/*/*.js README.md
|
||||
|
||||
fmt: format
|
||||
|
||||
|
|
|
@ -4,33 +4,39 @@ export async function data(tools) {
|
|||
const out = { speakers: [] };
|
||||
|
||||
const peopleMapper = {
|
||||
'Dušan Matuška': { country: 'sk' }
|
||||
}
|
||||
"Dušan Matuška": { country: "sk" },
|
||||
};
|
||||
|
||||
for (const el of $(".speaker").toArray()) {
|
||||
const value = (path) => cleanup($(path, el).text());
|
||||
const name = value("h3")
|
||||
const link = $("a", el).attr("href")
|
||||
const name = value("h3");
|
||||
const link = $("a", el).attr("href");
|
||||
|
||||
const $$ = await tools.loadHtmlUrl(link)
|
||||
const sp = $$('.container.pt-5')
|
||||
const $$ = await tools.loadHtmlUrl(link);
|
||||
const sp = $$(".container.pt-5");
|
||||
|
||||
const item = {
|
||||
id: link.match(/speakers\/(.+)\/$/)[1],
|
||||
name,
|
||||
photoUrl: $("img", el).attr("src"),
|
||||
caption: value(".popis"),
|
||||
twitter: $$("a.twitter", sp).attr("href")?.replace("https://twitter.com/",""),
|
||||
linkedin: $$("a.linkedIn", sp).attr("href")?.replace("https://www.linkedin.com/in/","").replace(/\/$/,""),
|
||||
twitter: $$("a.twitter", sp).attr("href")?.replace(
|
||||
"https://twitter.com/",
|
||||
"",
|
||||
),
|
||||
linkedin: $$("a.linkedIn", sp).attr("href")?.replace(
|
||||
"https://www.linkedin.com/in/",
|
||||
"",
|
||||
).replace(/\/$/, ""),
|
||||
tag: value(".taxTag "),
|
||||
//country: 'xx',
|
||||
desc: $$('p', sp).text(),
|
||||
desc: $$("p", sp).text(),
|
||||
web: { url: $$(".www", sp).attr("href") },
|
||||
link
|
||||
}
|
||||
link,
|
||||
};
|
||||
|
||||
if (peopleMapper[name]) {
|
||||
Object.assign(item, peopleMapper[name])
|
||||
Object.assign(item, peopleMapper[name]);
|
||||
}
|
||||
out.speakers.push(item);
|
||||
}
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
const peopleMapper = {
|
||||
"dcbuilder.eth": { country: "cz" },
|
||||
"luc.computer": { country: "nl" },
|
||||
"Ferit Tunçer": { country: "pt" },
|
||||
"Puncar": { country: "us" },
|
||||
"Miao ZhiCheng": { country: "ee" },
|
||||
"Cryptowanderer": { country: "za" },
|
||||
//"Daniel Lumi": { country: "" },
|
||||
"Nicolas Manea": { country: "gb" },
|
||||
"Tim Beiko": { country: "ca" },
|
||||
"Abeer Sharma": { country: "hk" },
|
||||
"Dustin Jacobus": { country: "be" },
|
||||
"Rhys Williams": { country: "gb" },
|
||||
"Sahil Sen": { country: "in" },
|
||||
"Steffen Kux": { country: "de" },
|
||||
};
|
||||
|
||||
export async function data($) {
|
||||
const res = await $.loadJSONUrl(
|
||||
"https://graphql.contentful.com/content/v1/spaces/6j1me6tz5h39/environments/master",
|
||||
{
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
query: `
|
||||
"dcbuilder.eth": { country: "cz" },
|
||||
"luc.computer": { country: "nl" },
|
||||
"Ferit Tunçer": { country: "pt" },
|
||||
"Puncar": { country: "us" },
|
||||
"Miao ZhiCheng": { country: "ee" },
|
||||
"Cryptowanderer": { country: "za" },
|
||||
//"Daniel Lumi": { country: "" },
|
||||
"Nicolas Manea": { country: "gb" },
|
||||
"Tim Beiko": { country: "ca" },
|
||||
"Abeer Sharma": { country: "hk" },
|
||||
"Dustin Jacobus": { country: "be" },
|
||||
"Rhys Williams": { country: "gb" },
|
||||
"Sahil Sen": { country: "in" },
|
||||
"Steffen Kux": { country: "de" },
|
||||
};
|
||||
|
||||
export async function data($) {
|
||||
const res = await $.loadJSONUrl(
|
||||
"https://graphql.contentful.com/content/v1/spaces/6j1me6tz5h39/environments/master",
|
||||
{
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
query: `
|
||||
{
|
||||
ethPraguePeopleSortedCollection(limit: 1) {
|
||||
items {
|
||||
|
@ -47,16 +47,17 @@ const peopleMapper = {
|
|||
}
|
||||
}
|
||||
}
|
||||
}`
|
||||
}),
|
||||
headers: {
|
||||
"content-type": "application/json",
|
||||
authorization: "Bearer 7xdKQm9l5CXQE6tXXKYxNQ_lgvanmpdUgT20pIlxfOk",
|
||||
},
|
||||
}`,
|
||||
}),
|
||||
headers: {
|
||||
"content-type": "application/json",
|
||||
authorization: "Bearer 7xdKQm9l5CXQE6tXXKYxNQ_lgvanmpdUgT20pIlxfOk",
|
||||
},
|
||||
);
|
||||
return {
|
||||
speakers: res.data.ethPraguePeopleSortedCollection.items[0].ethPraguePeopleSortedCollection.items.map((s) =>
|
||||
},
|
||||
);
|
||||
return {
|
||||
speakers: res.data.ethPraguePeopleSortedCollection.items[0]
|
||||
.ethPraguePeopleSortedCollection.items.map((s) =>
|
||||
Object.assign({
|
||||
id: $.formatId(s.name),
|
||||
name: s.name,
|
||||
|
@ -65,6 +66,5 @@ const peopleMapper = {
|
|||
photoUrl: s.profileImage?.url,
|
||||
}, peopleMapper[s.name] || {})
|
||||
).sort((x, y) => x.id > y.id ? -1 : 1),
|
||||
};
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,44 +1,46 @@
|
|||
export async function data(tools) {
|
||||
const $ = await tools.loadHtmlUrl("https://gateway.events/");
|
||||
const out = { speakers: [] };
|
||||
|
||||
const peopleMapper = {
|
||||
'Federico Kunze Küllmer': { country: 'de' },
|
||||
'Sunny Aggarwal': { country: 'tw' },
|
||||
'Zaki Manian': { country: 'us' },
|
||||
'Sergey Gorbunov': { country: 'us' },
|
||||
'Dean Tribble': { country: 'us' },
|
||||
'Sean Braithwaite': { country: 'de' }
|
||||
}
|
||||
|
||||
for (const el of $("#speakers div.w-full.relative").toArray()) {
|
||||
const value = (path) => cleanup($(path, el).text());
|
||||
const name = value("h3 span")
|
||||
const $ = await tools.loadHtmlUrl("https://gateway.events/");
|
||||
const out = { speakers: [] };
|
||||
|
||||
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);
|
||||
const peopleMapper = {
|
||||
"Federico Kunze Küllmer": { country: "de" },
|
||||
"Sunny Aggarwal": { country: "tw" },
|
||||
"Zaki Manian": { country: "us" },
|
||||
"Sergey Gorbunov": { country: "us" },
|
||||
"Dean Tribble": { country: "us" },
|
||||
"Sean Braithwaite": { country: "de" },
|
||||
};
|
||||
|
||||
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]);
|
||||
}
|
||||
//console.log(out)
|
||||
return out;
|
||||
out.speakers.push(item);
|
||||
}
|
||||
|
||||
function cleanup(str) {
|
||||
return str.replace(/(\s{2,}|\n)/g, " ").trim();
|
||||
}
|
||||
|
||||
//console.log(out)
|
||||
return out;
|
||||
}
|
||||
|
||||
function cleanup(str) {
|
||||
return str.replace(/(\s{2,}|\n)/g, " ").trim();
|
||||
}
|
||||
|
|
|
@ -12,45 +12,45 @@ const peopleMapper = {
|
|||
"Natália Rajnohová": { country: "sk" },
|
||||
"Olska Green": { country: "pt" },
|
||||
"Ondrej T.": { country: "sk" },
|
||||
"Pavla Julia Kolářová": { country: "cz" },
|
||||
"Sara Polak": { country: "cz" },
|
||||
"Thomas De Bruyne": { country: "be" },
|
||||
"Pavla Julia Kolářová": { country: "cz" },
|
||||
"Sara Polak": { country: "cz" },
|
||||
"Thomas De Bruyne": { country: "be" },
|
||||
"Timmu Toke": { country: "us" },
|
||||
"Julie Šislerová": { country: "cz" },
|
||||
"Kateřinak Škarabelová": { country: "cz" },
|
||||
};
|
||||
|
||||
export async function data(tools) {
|
||||
const $ = await tools.loadHtmlUrl("https://metaversefestivalprague.com/");
|
||||
const out = { speakers: [] };
|
||||
const $ = await tools.loadHtmlUrl("https://metaversefestivalprague.com/");
|
||||
const out = { speakers: [] };
|
||||
|
||||
for (const el of $("div.elementor-col-16").toArray()) {
|
||||
const name = cleanupName($('h3 span', el).html())
|
||||
if (name === "Reveal Soon") {
|
||||
continue;
|
||||
}
|
||||
|
||||
const item = {
|
||||
id: tools.formatId(name),
|
||||
name,
|
||||
caption: $('p.elementor-icon-box-description', el).text().trim(),
|
||||
photoUrl: $('div.elementor-widget-container img', el).attr('src'),
|
||||
}
|
||||
|
||||
if (peopleMapper[name]) {
|
||||
Object.assign(item, peopleMapper[name])
|
||||
}
|
||||
out.speakers.push(item);
|
||||
for (const el of $("div.elementor-col-16").toArray()) {
|
||||
const name = cleanupName($("h3 span", el).html());
|
||||
if (name === "Reveal Soon") {
|
||||
continue;
|
||||
}
|
||||
|
||||
return out;
|
||||
const item = {
|
||||
id: tools.formatId(name),
|
||||
name,
|
||||
caption: $("p.elementor-icon-box-description", el).text().trim(),
|
||||
photoUrl: $("div.elementor-widget-container img", el).attr("src"),
|
||||
};
|
||||
|
||||
if (peopleMapper[name]) {
|
||||
Object.assign(item, peopleMapper[name]);
|
||||
}
|
||||
out.speakers.push(item);
|
||||
}
|
||||
|
||||
function cleanupName (str) {
|
||||
return Html5Entities.decode(str.trim())
|
||||
.replace(/\s?<br>\s?/, ' ')
|
||||
.toLowerCase()
|
||||
.split(' ')
|
||||
.map(str => str.charAt(0).toUpperCase() + str.slice(1))
|
||||
.join(' ')
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
function cleanupName(str) {
|
||||
return Html5Entities.decode(str.trim())
|
||||
.replace(/\s?<br>\s?/, " ")
|
||||
.toLowerCase()
|
||||
.split(" ")
|
||||
.map((str) => str.charAt(0).toUpperCase() + str.slice(1))
|
||||
.join(" ");
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ export async function data($) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}`
|
||||
}`,
|
||||
}),
|
||||
headers: {
|
||||
"content-type": "application/json",
|
||||
|
@ -51,14 +51,15 @@ export async function data($) {
|
|||
},
|
||||
);
|
||||
return {
|
||||
speakers: res.data.pragueDefiSummitPeopleSortedCollection.items[0].pdsPeopleSortedCollection.items.map((s) =>
|
||||
Object.assign({
|
||||
id: $.formatId(s.name),
|
||||
name: s.name,
|
||||
twitter: s.twitter.replace("https://twitter.com/", ""),
|
||||
caption: s.company || "",
|
||||
photoUrl: s.profileImage?.url,
|
||||
}, peopleMapper[s.name] || {})
|
||||
),
|
||||
speakers: res.data.pragueDefiSummitPeopleSortedCollection.items[0]
|
||||
.pdsPeopleSortedCollection.items.map((s) =>
|
||||
Object.assign({
|
||||
id: $.formatId(s.name),
|
||||
name: s.name,
|
||||
twitter: s.twitter.replace("https://twitter.com/", ""),
|
||||
caption: s.company || "",
|
||||
photoUrl: s.profileImage?.url,
|
||||
}, peopleMapper[s.name] || {})
|
||||
),
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
export async function data($) {
|
||||
const bundle = await $.loadJSONUrl("https://spec.utxo.cz/23/bundle.json");
|
||||
return {
|
||||
speakers: bundle.spec.speakers.map(s => {
|
||||
speakers: bundle.spec.speakers.map((s) => {
|
||||
if (s.photos && s.photos[0]) {
|
||||
const [ tp, ext ] = s.photos[0].split(":")
|
||||
s.photoUrl = `https://spec.utxo.cz/23/photos/speakers/${s.id}-${tp}.${ext}`
|
||||
const [tp, ext] = s.photos[0].split(":");
|
||||
s.photoUrl =
|
||||
`https://spec.utxo.cz/23/photos/speakers/${s.id}-${tp}.${ext}`;
|
||||
}
|
||||
return s
|
||||
return s;
|
||||
}),
|
||||
tracks: bundle.spec.tracks,
|
||||
};
|
||||
|
|
|
@ -1,20 +1,22 @@
|
|||
|
||||
const peopleMapper = {
|
||||
//"Radek Svarz": { country: "cz" },
|
||||
//"Radek Svarz": { country: "cz" },
|
||||
};
|
||||
|
||||
export async function data($) {
|
||||
const res = await $.loadJSONUrl("https://prague.web3privacy.info/config.json");
|
||||
return {
|
||||
speakers: res.speakers.map(pid => res.people.find(p => p.id === pid)).map((s) =>
|
||||
Object.assign({
|
||||
id: $.formatId(s.name),
|
||||
name: s.name,
|
||||
twitter: s.twitter,
|
||||
caption: s.caption,
|
||||
country: s.country,
|
||||
photoUrl: `https://prague.web3privacy.info/people/${s.img}`,
|
||||
}, peopleMapper[s.name] || {})
|
||||
),
|
||||
};
|
||||
}
|
||||
const res = await $.loadJSONUrl(
|
||||
"https://prague.web3privacy.info/config.json",
|
||||
);
|
||||
return {
|
||||
speakers: res.speakers.map((pid) => res.people.find((p) => p.id === pid))
|
||||
.map((s) =>
|
||||
Object.assign({
|
||||
id: $.formatId(s.name),
|
||||
name: s.name,
|
||||
twitter: s.twitter,
|
||||
caption: s.caption,
|
||||
country: s.country,
|
||||
photoUrl: `https://prague.web3privacy.info/people/${s.img}`,
|
||||
}, peopleMapper[s.name] || {})
|
||||
),
|
||||
};
|
||||
}
|
||||
|
|
Načítá se…
Odkázat v novém úkolu