Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
1
2
3
4
5
6
7
8
9
10
11
12
import { treccaniScrapeDates } from "https://esm.town/v/paolobrasolin/treccaniScrapeDates";
export const cerberoScrapeTerm = async (term: string) => {
const query = term.replace(" ", "-"); // NOTE: not sure this is exhaustive
const voc_url =
`https://www.treccani.it/vocabolario/${query}_%28Neologismi%29/`;
const enc_url = `https://www.treccani.it/enciclopedia/${query}_%28altro%29/`;
return {
[voc_url]: await treccaniScrapeDates(voc_url),
[enc_url]: await treccaniScrapeDates(enc_url),
};
};
October 23, 2023