Skip to content

Commit

Permalink
Fix CL events scraper
Browse files Browse the repository at this point in the history
  • Loading branch information
alexhorn committed Apr 13, 2024
1 parent d94b381 commit 2397114
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rogue-thi-app/pages/api/cl-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ async function getEventDetails(fetch, url) {
return Object.fromEntries(
rows.map((elem) => {
return [
$(elem).find('.c0 > b').text().trim(),
$(elem).find('.c1').text().trim(),
$(elem).find('.c0').text().trim().replace(/:$/, ''),
$(elem).find('.c1').text().trim().replace(/:$/, ''),
]
})
)
Expand All @@ -166,6 +166,7 @@ export async function getAllEventDetails(username, password) {
const details = await getEventDetails(fetch, url)
// do not include location and description
// since it may contain sensitive information
console.log(details)
remoteEvents.push({
id: crypto.createHash('sha256').update(url).digest('hex'),
organizer: details.Verein.trim().replace(/( \.)$/g, ''),
Expand Down

0 comments on commit 2397114

Please sign in to comment.