chore(api): update referrers list

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-12-03 20:49:08 +01:00
parent 335fcf0f7a
commit 6e57a8337e
2 changed files with 10 additions and 1 deletions

View File

@@ -1,6 +1,11 @@
import fs from 'node:fs'; import fs from 'node:fs';
import path from 'node:path'; import path from 'node:path';
// extras
const extraReferrers = {
'bsky.app': { type: 'social', name: 'Bluesky' },
};
function transform(data: any) { function transform(data: any) {
const obj: Record<string, unknown> = {}; const obj: Record<string, unknown> = {};
for (const type in data) { for (const type in data) {
@@ -34,7 +39,10 @@ async function main() {
`// The orginal referers.yml is based on Piwik's SearchEngines.php and Socials.php, copyright 2012 Matthieu Aubry and available under the GNU General Public License v3.`, `// The orginal referers.yml is based on Piwik's SearchEngines.php and Socials.php, copyright 2012 Matthieu Aubry and available under the GNU General Public License v3.`,
'', '',
`const referrers: Record<string, { type: string, name: string }> = ${JSON.stringify( `const referrers: Record<string, { type: string, name: string }> = ${JSON.stringify(
transform(data), {
...transform(data),
...extraReferrers,
},
)} as const;`, )} as const;`,
'export default referrers;', 'export default referrers;',
].join('\n'), ].join('\n'),

View File

@@ -2680,5 +2680,6 @@ const referrers: Record<string, { type: string; name: string }> = {
'hyves.nl': { type: 'social', name: 'Hyves' }, 'hyves.nl': { type: 'social', name: 'Hyves' },
'paper.li': { type: 'social', name: 'Paper.li' }, 'paper.li': { type: 'social', name: 'Paper.li' },
'moikrug.ru': { type: 'social', name: 'MoiKrug.ru' }, 'moikrug.ru': { type: 'social', name: 'MoiKrug.ru' },
'bsky.app': { type: 'social', name: 'Bluesky' },
} as const; } as const;
export default referrers; export default referrers;