Skip to content

Commit

Permalink
chore: move bluesky labelers to its own table
Browse files Browse the repository at this point in the history
  • Loading branch information
mary-ext committed Oct 19, 2024
1 parent fa9b0e1 commit b435497
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 12 deletions.
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Scraped AT Protocol instances

Last updated: 2024-10-19T07:27:55.625Z[^1]
Last updated: 2024-10-19T07:35:36.133Z[^1]

Found by enumerating plc.directory and bsky.network, some instances might not be
part of mainnet.
Expand Down Expand Up @@ -590,7 +590,19 @@ Instances that have not been active for more than 7 days gets dropped off from t
**69** online
**14** offline

<!-- labeler-start -->
### Bluesky labelers

<!-- bsky-labeler-start -->
| Labeler | Version |
| --- | --- |
| ✅ mod-br.bsky.app | git-60df3fc |
| ✅ mod-de.bsky.app | git-60df3fc |
| ✅ mod.bsky.app | git-60df3fc |
<!-- bsky-labeler-end -->

### Third-party labelers

<!-- 3p-labeler-start -->
| Labeler | Version |
| --- | --- |
| ✅ 2.ripperoni.com | 0.1.38 |
Expand Down Expand Up @@ -620,11 +632,8 @@ Instances that have not been active for more than 7 days gets dropped off from t
| ❌ medsky.williancima.dev | ??? |
| ✅ merke.maanebedotten.no | 0.1.38 |
| ❌ mimonelu.net | ??? |
| ✅ mod-br.bsky.app | git-60df3fc |
| ✅ mod-de.bsky.app | git-60df3fc |
| ✅ mod.armifi.com | 0.1.38 |
| ✅ mod.blackskyweb.xyz | 0.1.38 |
| ✅ mod.bsky.app | git-60df3fc |
| ✅ mod.laelaps.fyi | 0.1.38 |
| ✅ mod.staging.bsky.dev | git-60df3fc |
| ❌ mod.zio.blue | ??? |
Expand Down Expand Up @@ -676,6 +685,8 @@ Instances that have not been active for more than 7 days gets dropped off from t
| ✅ uspollabeler.blakeslabs.com | 0.1.38 |
| ✅ warlabel.dattil.io | 0.1.38 |
| ✅ xblock.aendra.dev | 0.1.38 |
<!-- labeler-end -->
<!-- 3p-labeler-end -->

---

[^1]: Reflecting actual changes, not when the scraper was last run
32 changes: 26 additions & 6 deletions scripts/generate-markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ let state: SerializedState | undefined;
{
const PDS_BSKY_TABLE = /(?<=<!-- bsky-pds-start -->)[^]*(?=<!-- bsky-pds-end -->)/;
const PDS_3P_TABLE = /(?<=<!-- 3p-pds-start -->)[^]*(?=<!-- 3p-pds-end -->)/;
const LABELER_RE = /(?<=<!-- labeler-start -->)[^]*(?=<!-- labeler-end -->)/;
const LABELER_BSKY_RE = /(?<=<!-- bsky-labeler-start -->)[^]*(?=<!-- bsky-labeler-end -->)/;
const LABELER_3P_RE = /(?<=<!-- 3p-labeler-start -->)[^]*(?=<!-- 3p-labeler-end -->)/;

const template = `# Scraped AT Protocol instances
Expand All @@ -52,7 +53,15 @@ Instances that have not been active for more than 7 days gets dropped off from t
{{labelerSummary}}
<!-- labeler-start --><!-- labeler-end -->
### Bluesky labelers
<!-- bsky-labeler-start --><!-- bsky-labeler-end -->
### Third-party labelers
<!-- 3p-labeler-start --><!-- 3p-labeler-end -->
---
[^1]: Reflecting actual changes, not when the scraper was last run
`;
Expand All @@ -67,7 +76,12 @@ Instances that have not been active for more than 7 days gets dropped off from t
| --- | --- | --- |
`;

let labelerTable = `
let labeler3pTable = `
| Labeler | Version |
| --- | --- |
`;

let labelerBskyTable = `
| Labeler | Version |
| --- | --- |
`;
Expand Down Expand Up @@ -99,7 +113,11 @@ Instances that have not been active for more than 7 days gets dropped off from t
const on = errorAt === undefined ? '✅' : '❌';
const v = version || (version === null ? 'N/A' : '???');

labelerTable += `| ${on} ${host} | ${v} |\n`;
if (host.endsWith('.bsky.app')) {
labelerBskyTable += `| ${on} ${host} | ${v} |\n`;
} else {
labeler3pTable += `| ${on} ${host} | ${v} |\n`;
}
}

// Read existing Markdown file, check if it's equivalent
Expand All @@ -111,7 +129,8 @@ Instances that have not been active for more than 7 days gets dropped off from t
if (
PDS_3P_TABLE.exec(source)?.[0] === pds3pTable &&
PDS_BSKY_TABLE.exec(source)?.[0] === pdsBskyTable &&
LABELER_RE.exec(source)?.[0] === labelerTable
LABELER_3P_RE.exec(source)?.[0] === labeler3pTable &&
LABELER_BSKY_RE.exec(source)?.[0] === labelerBskyTable
) {
shouldWrite = false;
}
Expand All @@ -125,7 +144,8 @@ Instances that have not been active for more than 7 days gets dropped off from t
.replace('{{labelerSummary}}', getLabelerSummary())
.replace(PDS_3P_TABLE, pds3pTable)
.replace(PDS_BSKY_TABLE, pdsBskyTable)
.replace(LABELER_RE, labelerTable);
.replace(LABELER_3P_RE, labeler3pTable)
.replace(LABELER_BSKY_RE, labelerBskyTable);

await Bun.write(env.RESULT_FILE, final);
console.log(`wrote to ${env.RESULT_FILE}`);
Expand Down

0 comments on commit b435497

Please sign in to comment.