<sup/> tags in birthday

This commit is contained in:
Wouter Groeneveld 2021-03-30 16:04:38 +02:00
parent e4c2aaf260
commit 71572a67c5
2 changed files with 4 additions and 2 deletions

View File

@ -17,7 +17,9 @@ async function chat() {
const animaldb = await collect()
const possibleToots = animaldb.animals.map(record => {
return record.quotes.map(quote => {
const birthday = record.birthday.replace(/\n/g, "")
const birthday = record.birthday
.replace(/<sup>(.*)<\/sup>/g, "$1")
.replace(/\n/g, "")
return {
"toot": `${record.name}: "${quote}"\n\n${birthday} is my birthday.\nhttps://animalcrossing.fandom.com${record.href}`,
"attach": `data/ac/${md5(record.img)}.png`,

View File

@ -73,7 +73,7 @@ async function collect() {
await fsp.writeFile('data/ac/animals.json', JSON.stringify({ animals }, null, 2))
console.log(' AC buddy: Okay, animals.json written!')
return animals
return { animals }
}