diff options
Diffstat (limited to 'app/scrapers/warp-kichijoji.ts')
| -rw-r--r-- | app/scrapers/warp-kichijoji.ts | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/app/scrapers/warp-kichijoji.ts b/app/scrapers/warp-kichijoji.ts index 8a828ea..8929fef 100644 --- a/app/scrapers/warp-kichijoji.ts +++ b/app/scrapers/warp-kichijoji.ts @@ -76,10 +76,28 @@ export const scraper: Scraper = { ? rawImg.replace(/^https?:\/\/sp-ao\.shortpixel\.ai\/client\/[^/]+\//, "") : null; + // Artists in <div class="w-flyer"> separated by <br> + // notes-wrapper and detail-texts are nested inside w-flyer — clone and strip them + const $wFlyer = $el.find("div.w-flyer").first().clone(); + $wFlyer.find("section.notes-wrapper, div.detail-texts").remove(); + $wFlyer.find("br").replaceWith("\n"); + const rawArtist = $wFlyer.text(); + const artistLines: string[] = []; + for (const raw of rawArtist.split("\n")) { + const l = raw.trim(); + if (!l) { + if (artistLines.length > 0) break; // stop at first blank line after artists + continue; + } + if (/^[■▼◼▶◆]|チケット|ticket|TICKET|予約|http|\d{1,2}:\d{2}|[¥¥]/i.test(l)) break; + artistLines.push(l); + } + const artist = artistLines.length > 0 ? artistLines.join(" / ") : null; + events.push({ venue_id: venue.id, title, - artist: null, + artist, date, open_time: isTime(openTime) ? openTime : null, start_time: isTime(startTime) ? startTime : null, |
