nx_entity_media.nx
buildroot/runtime/nx_entity_media.nx
about
nx_entity_media.nx -- MULTI-IMAGE entity media gather.
Supersedes the 1-image demo in nx_media_gather.nx, which fetched exactly ONE image and only if its URL
contained a hardcoded "upload.wikimedia.org". Here: fetch an entity page over sovereign validated HTTPS,
extract ALL image URLs, fetch each (polite pacing), sniff + sha256 + content-address into
knowledge/media/<entity>/, dedupe by digest within the run, and append a provenance row per stored asset.
No host allowlist: any http(s) image URL is eligible. Bounds are PARAMETERS, not literals -- the intended
limits are hardware and politeness, nothing else. A hit cap is REPORTED (capped=1), never silent.
usage: nx_entity_media <page-url> <entity-slug> [max_imgs] [pace_ms]
dependencies 11 imports · 0 importers
diagram shows first 10 each side; +1 more imports, +0 more importers in the complete lists below.
imports: nx_str.nxnx_syscalls.nxnx_csprng.nxnx_x509_trust_store.nxnx_pem_loader.nxnx_https_get.nxnx_html_extract_imgs.nxnx_media_sniff.nxnx_sha256.nxnx_inflate.nxnx_http_dechunk.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 24 | const EM_MAGIC_2048: i64 = 2048 |
| 26 | const EM_PAGE_CAP: i64 = 4194304 |
| 27 | const EM_IMG_CAP: i64 = 8388608 |
| 30 | const EM_URLBUF: i64 = 2097152 |
| 31 | const EM_MAX_IMGS: i64 = 4096 |
| 32 | const EM_PATHBUF: i64 = 4096 |
| 33 | const EM_DEF_PACE_MS: i64 = 800 |
functions
| 35 | func em_puts(s: *u8) -> i64 { sys_write(1, s, nx_str_len(s)); return 0 } |
| 36 | func em_w(fd: i64, s: *u8) -> i64 { sys_write(fd, s, nx_str_len(s)); return 0 } |
| 38 | func em_num(v: i64, o: *u8) -> i64 |
| 51 | func em_pi(v: i64) -> i64 { let o: *u8 = sys_mmap(32); let n: i64 = em_num(v, o); sys_write(1, o, n); return 0 } |
| 52 | func em_wn(fd: i64, v: i64) -> i64 { let o: *u8 = sys_mmap(32); let n: i64 = em_num(v, o); sys_write(fd, o, n); return 0 } |
| 54 | func em_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { dst[off+i] = s[i]; i = i + 1 } return off + i } called by 1: em_upsize |
| 56 | func em_mkdir(path: *u8) -> i64 { return __syscall(258, -100, path, 0x1ed, 0, 0, 0) } |
| 58 | func em_atoi(s: *u8) -> i64 |
| 69 | func em_hex(d: *u8, out: *u8) -> i64 |
| 82 | func em_body_off(resp: *u8, n: i64) -> i64 |
| 91 | func em_write_file(path: *u8, buf: *u8, n: i64) -> i64 |
| 105 | func em_is_http(u: *u8, n: i64) -> i64 |
| 115 | func em_seen(seen: *u8, nseen: i64, dg: *u8) -> i64 |
| 127 | func em_ledger(lg: i64, entity: *u8, page: *u8, iurl: *u8, n: i64, hex: *u8, kind: *u8) -> i64 |
| 138 | func em_doss(df: i64, entity: *u8, iurl: *u8, hex: *u8, kind: *u8, n: i64) -> i64 |
| 159 | func em_ends(u: *u8, n: i64, s: *u8) -> i64 |
| 167 | func em_raster_ext(u: *u8, n: i64) -> i64 |
| 179 | func em_upsize(u: *u8, n: i64, out: *u8) -> i64 |
| 240 | func em_inflate_if_gzip(src: *u8, n: i64, dst: *u8, cap: i64) -> i64 calls 1: inf_gunzip |
| 249 | func main(argc: i64, argv: *i64) -> i64 |