Unlisted
Edited
Apr 14
Insert cell
Insert cell
Changed
-
viewof filtro = Inputs.text({ label: "Filtro" })
+
viewof filtro = { let input, resolve; const form = html`<form> <label>Buscar: <input name="busqueda" placeholder="Escribí algo..."></label> <button type="submit">Buscar</button> </form>`; // Creamos un input view para que sea reactive const promise = new Promise((res) => (resolve = res)); form.onsubmit = (event) => { event.preventDefault(); // prevenir que se recargue la página resolve(input.value); input.select(); // opcional, selecciona el texto para otra búsqueda }; input = form.querySelector("input"); form.value = undefined; form.addEventListener("input", () => form.dispatchEvent(new CustomEvent("input")) ); Object.defineProperty(form, "value", { get: () => promise }); return form; }
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
zipreader = (fileDescriptor, { type = "string" } = {}) =>
fileDescriptor
.arrayBuffer()
.then((d) => jszip().loadAsync(d))
.then(
({ files }) =>
new Map(Object.keys(files).map((f) => [f, files[f].async(type)]))
)
Insert cell
zipFile = zipreader(FileAttachment("all-tweets-jmilei-2024-07-20-nulo.in.zip"))
Insert cell
fullDataPatch = (await zipreader(FileAttachment("patch.jsonl.zip")))
.get("patch.jsonl")
.then((content) =>
content
.split("\n")
.filter((line) => line.trim() !== "")
.map(JSON.parse)
)
Insert cell
Insert cell
Insert cell
Insert cell
Array.from(diasConTuits)
.map((d) => d[1])
.filter((d) => d.fecha > new Date(2025, 1, 13))
Insert cell
Insert cell
Insert cell
diasSinTuits = todasLasFechas.filter((d) => !diasConTuits.get(d))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell