-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a737565
commit 512668e
Showing
15 changed files
with
165 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
dist | ||
.sl | ||
output | ||
output | ||
.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,6 @@ collections: | |
companies: {} | ||
people: | ||
model: person | ||
projects: {} | ||
projects: {} | ||
extenders: | ||
eips: {} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
name: Mario Havel | ||
links: | ||
twitter: https://twitter.com/TMIYChao | ||
twitter: https://twitter.com/TMIYChao | ||
github: https://github.com/taxmeifyoucan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: Micah Zoltu | ||
links: | ||
github: https://github.com/MicahZoltu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
name: Péter Szilágyi | ||
emails: | ||
- [email protected] | ||
- [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
name: Vitalik Buterin | ||
links: | ||
twitter: https://twitter.com/VitalikButerin | ||
github: https://github.com/vbuterin | ||
twitter: https://twitter.com/VitalikButerin | ||
emails: | ||
- [email protected] | ||
- [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: Ethereum Attestation Service | ||
abbreviations: | ||
- EAS | ||
links: | ||
web: https://attest.sh/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import Engine from "./engine.js"; | ||
import cheerio from "npm:[email protected]"; | ||
import { ensureDir, exists } from "https://deno.land/[email protected]/fs/mod.ts"; | ||
|
||
const e = new Engine(); | ||
await e.init(); | ||
|
||
const CACHE_DIR = "./.cache"; | ||
|
||
const tools = { | ||
async loadHtmlUrl(url) { | ||
await ensureDir(CACHE_DIR); | ||
const hash = Array.from( | ||
new Uint8Array( | ||
await crypto.subtle.digest("SHA-256", (new TextEncoder()).encode(url)), | ||
), | ||
).map((b) => b.toString(16).padStart(2, "0")).join(""); | ||
const cacheFn = `${CACHE_DIR}/${hash}`; | ||
|
||
if (await exists(cacheFn)) { | ||
console.log(`Cache found! ${hash}`); | ||
return cheerio.load(await Deno.readTextFile(cacheFn)); | ||
} | ||
|
||
console.log(`Getting ${url}`); | ||
const resp = await fetch(url, { | ||
headers: { | ||
"User-Agent": | ||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15", | ||
}, | ||
}); | ||
const output = await resp.text(); | ||
await Deno.writeTextFile(cacheFn, output); | ||
return cheerio.load(output); | ||
} | ||
} | ||
|
||
for (const extId in e.config.extenders) { | ||
console.log(`Running extender: ${extId}`) | ||
const ext = await import(`./extenders/${extId}.js`) | ||
await ext.process(e, tools) | ||
} | ||
|
||
console.log(`Extending done`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
export async function process(db, _) { | ||
const authors = {} | ||
const $ = await _.loadHtmlUrl("https://eips.ethereum.org/all") | ||
for (const el of $('table.eiptable tr').toArray()) { | ||
const eipnum = $('td.eipnum a', el).text() | ||
for (const a of $('td.author', el).text().split(', ')) { | ||
if (!a) { | ||
continue | ||
} | ||
if (!authors[a]) { | ||
authors[a] = [] | ||
} | ||
authors[a].push(eipnum) | ||
} | ||
} | ||
|
||
const matrix = [] | ||
|
||
for (const a of Object.keys(authors)) { | ||
const info = {} | ||
|
||
// name | ||
const nameMatch = a.match(/^([^<^\()]+)/) | ||
if (!nameMatch) { | ||
console.log(`Bad name? ${a}`) | ||
} | ||
info.name = nameMatch[1].trim() | ||
|
||
// github handle | ||
const ghMatch = a.match(/\(@([^\)]+)\)/) | ||
if (ghMatch) { | ||
info.github = ghMatch[1] | ||
} | ||
const emailMatch = a.match(/<([^>]+)>/) | ||
if (emailMatch) { | ||
info.email = emailMatch[1] | ||
} | ||
//console.log(`${a} - ${JSON.stringify(info)}`) | ||
|
||
const dbFind = db.collections.people.find(p => { | ||
if (info.github && p.index.links?.github?.toLowerCase() === `https://github.com/${info.github.toLowerCase()}`) { | ||
return true | ||
} | ||
if (info.email && p.index.emails?.includes(info.email)) { | ||
return true | ||
} | ||
}) | ||
if (dbFind) { | ||
let matrixItem = matrix.find(mi => mi.slug === dbFind.index.slug) | ||
if (!matrixItem) { | ||
matrixItem = { | ||
slug: dbFind.index.slug, | ||
info, | ||
eips: [], | ||
} | ||
matrix.push(matrixItem) | ||
} | ||
matrixItem.eips = matrixItem.eips.concat(authors[a]).sort() | ||
} else { | ||
matrix.push({ | ||
slug: null, | ||
info, | ||
eips: authors[a] | ||
}) | ||
} | ||
//console.log(`${info.name} -> ${dbFind ? dbFind.index.slug : 'x'}`) | ||
} | ||
//console.log(matrix) | ||
|
||
// finishing, modify or create people | ||
|
||
for (const p of matrix) { | ||
if (p.slug) { | ||
console.log(`${p.info.name} => ${p.slug} (auto)`) | ||
continue | ||
} | ||
const duplicates = [] | ||
|
||
console.log(`-----\n${p.info.name} (${JSON.stringify(p)})\n`) | ||
prompt("Do you want to create new one?") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters