diff --git a/content/team.json b/content/team.json index 1889e0fada9..91cd8237ac3 100644 --- a/content/team.json +++ b/content/team.json @@ -367,5 +367,15 @@ "customKey": "696969", "customValue": "xVJWaSLb2QkQrhwfc3VG" } + }, + "spok": { + "name": "spok", + "url": "https://fairtalk.tv", + "image": "/img/team/spok.png", + "v4v": { + "address": "030a58b8653d32b99200a2334cfe913e51dc7d155aa0116c176657a4f1722677a3", + "customKey": "696969", + "customValue": "BhSmEGwARJfwZFeZW1Ma" + } } } diff --git a/helpers.js b/helpers.js index b58e3be2c57..7ea3e43861d 100644 --- a/helpers.js +++ b/helpers.js @@ -68,6 +68,8 @@ const teamWithAliases = team => { return withAliases } +const participantToId = p => p.replace(/\(.*?\)/, '').trim().toLowerCase() + module.exports = { markdown: mdTransformer.render, replacements, @@ -75,5 +77,6 @@ module.exports = { stripHTML, truncate, teamWithAliases, + participantToId, toMeetupMapInfo } diff --git a/src/includes/mixins.pug b/src/includes/mixins.pug index c6e05e1f8d0..504d9d208ba 100644 --- a/src/includes/mixins.pug +++ b/src/includes/mixins.pug @@ -96,7 +96,7 @@ mixin spende(d, trunc = false) mixin participants(ps, link) .participants for name in ps - - const id = name.toLowerCase() + - const id = participantToId(name) - const member = team[id] if member if link diff --git a/static/img/team/spok.png b/static/img/team/spok.png new file mode 100644 index 00000000000..55371e82860 Binary files /dev/null and b/static/img/team/spok.png differ diff --git a/tasks/fetch_feed.js b/tasks/fetch_feed.js index d7524b21b69..872b66bceee 100644 --- a/tasks/fetch_feed.js +++ b/tasks/fetch_feed.js @@ -1,6 +1,6 @@ const { writeFileSync } = require('fs') const { join, resolve } = require('path') -const { replacements, slugify, stripHTML, teamWithAliases } = require('../helpers') +const { replacements, slugify, stripHTML, teamWithAliases, participantToId } = require('../helpers') const { masterFeedUrl, publicFeedUrl } = require('../content/meta.json') const teamRaw = require('../content/team.json') const request = require('sync-request') @@ -67,13 +67,14 @@ const parseEpisode = e => { : `/img/cover/${category}.png` const duration = e['itunes:duration'] const enclosure = e.enclosure.__attr - const [, participantsString] = + const [, participantsString, additionalString] = firstLine.match(/[-–—]\s?(?:(?:(?:von\sund\s)?mit\s)|(?:gelesen\svon\s))([^.]*)/i) || [] const participants = participantsString ? participantsString - .replace(/(\s*,\s*|\s*und\s*|\s*&\s*)/gi, '%') + .replace(/(\s*,\s*|\s*und\s*|\s*sowie\s*|\s*&\s*)/gi, '%') .trim() .split('%') + .filter(p => !!p) .map(p => p.trim()) : [] return { @@ -149,7 +150,6 @@ const parseEpisode = e => { ...item, link, // replace Anchor link description: { __cdata: description }, - //'itunes:summary': description // please the validator, Anchor's itunes:summary contains HTML } // itunes:summary seems to be gone: https://help.apple.com/itc/podcasts_connect/#/itcb54353390 delete updated['itunes:summary'] @@ -164,7 +164,7 @@ const parseEpisode = e => { } const value = episode.participants.reduce((result, name) => { - const id = name.toLowerCase() + const id = participantToId(name) const v4v = team[id] && team[id].v4v if (v4v) { result.push({ name, ...v4v }) @@ -193,7 +193,7 @@ const parseEpisode = e => { } const people = episode.participants.reduce((result, name) => { - const id = name.toLowerCase() + const id = participantToId(name) const person = team[id] if (person) { result.push(person) diff --git a/tasks/generate_pages.js b/tasks/generate_pages.js index 720538a9850..288267d86b1 100644 --- a/tasks/generate_pages.js +++ b/tasks/generate_pages.js @@ -1,7 +1,7 @@ const pug = require('pug') const { mkdirSync, writeFileSync } = require('fs') const { dirname, resolve } = require('path') -const { slugify, teamWithAliases } = require('../helpers') +const { slugify, teamWithAliases, participantToId } = require('../helpers') const config = require('../pug.config') const site = require('../generated/site-data.json') const episodes = require('../generated/episodes.json') @@ -61,6 +61,6 @@ Object.keys(categories).forEach(category => renderPage('category', `podcast/${sl Object.keys(teamRaw).forEach(id => { const member = teamRaw[id] const aliases = (member.aliases || []).map(m => m.toLowerCase()).concat(member.name.toLowerCase()) - const eps = episodes.filter(e => e.participants.find(p => [id, ...aliases].includes(p.toLowerCase()))) + const eps = episodes.filter(e => e.participants.find(p => [id, ...aliases].includes(participantToId(p)))) renderPage('member', `team/${slugify(id)}`, { navCurrent: 'podcast', member, episodes: eps, team }) })