This is for Poznań, Poland only. Data taken from https://www.rckik.poznan.pl/najblizsze-wyjazdy

It'll show a list of next places where you can find a bus in which you can donate a blood in Poznań - filtered by given text so you can narrow list to locations closest to you.

This is WIP - I'll try to optimize it and maybe make the list easier to read.

Screenshot 2021-10-19 at 11 39 17

Install rckik

// Menu: RCKIK mobile
// Description: Show filtered plan of mobile RCKIK busses
// Author: Jakub Olek
// Twitter: @JakubOlek
/** @type {import("@johnlindquist/kit")} */
function transform(node) {
// Edit that to filter locations that you're interested in
// has to be inside transform function - as it's being serialized and passed to browser
const filter = "Poznań";
const columns = [...node.querySelectorAll("td")];
if (columns[3].innerHTML.startsWith(filter)) {
return (
columns[0].querySelector("a").innerHTML +
" " +
columns[3].innerHTML +
" " +
columns[2].innerHTML
);
}
}
const pagination = await scrapeSelector(
"https://www.rckik.poznan.pl/najblizsze-wyjazdy?page=1",
".pagination li"
);
const numberOfPages = pagination.length;
let t = [];
for (let i = 1; i <= numberOfPages; i += 1) {
const result = await scrapeSelector(
`https://www.rckik.poznan.pl/najblizsze-wyjazdy?page=${i}`,
"#calendarTable tr:not(.header):not(.canceled)",
transform
);
t = t.concat(result);
}
div(
`<ul>${t
.filter(Boolean)
.map((date) => `<li>${date}</li>`)
.join("")}</ul>`,
"p-4"
);