code wiki / (root) / nx_award_ui_research_fetch.nx

nx_award_ui_research_fetch.nx source

↩ module page · 84 lines · 6058 B

1// nx_award_ui_research_fetch.nx -- the Nishi RESEARCHER's sovereign LIVE fetch for the AWARD-WINNING / "objectively 2// incredible" web-design bar (Awwwards / CSS Design Awards / Webby grade): the CREATIVITY + ART-DIRECTION axis the 3// brand-fundamentals corpus doesn't cover. Grounds an honest award-UI census in real facts, not self-judgement. 4// Mirrors the proven nx_brand_exceed_research_fetch pattern EXACTLY (own TLS-1.3, Mozilla CA, idempotent have-skip) 5// -> knowledge/fetched/aw_*.raw. 100% sovereign. expect_exit: 0 license_tier: ORIGINAL 6import "nx_syscalls.nx" 7import "nx_x509_trust_store.nx" 8import "nx_trust_store_load_from_certdata.nx" 9import "nx_https_fetch_follow.nx" 10const K_MAGIC_4194304: i64 = 4194304 11const K_MAGIC_8388608: i64 = 8388608 12 13func ff_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } 14func ff_putn(v: i64) -> i64 { 15 if v == 0 { sys_write(1, "0" as *u8, 1); return 0 } 16 var m: i64 = v 17 if m < 0 { sys_write(1, "-" as *u8, 1); m = 0 - m } 18 let d: *u8 = sys_mmap(24); var k: i64 = 0 19 while m > 0 { d[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 } 20 var j: i64 = k - 1 21 while j >= 0 { sys_write(1, ((d as i64)+j) as *u8, 1); j = j - 1 } 22 return 0 23} 24func have_file(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 } 25func fetch_save(url: *u8, opath: *u8, store: *TrustStore, out: *u8, cap: i64) -> i64 { 26 if have_file(opath) == 1 { ff_puts(opath); ff_puts(" [have-skip]\n" as *u8); return 1 } 27 let status: *i64 = sys_mmap(8) as *i64 28 let n: i64 = nx_https_fetch_follow(url, store, out, cap, 6, status) 29 ff_puts(url); ff_puts(" status=" as *u8); ff_putn(status[0]); ff_puts(" bytes=" as *u8); ff_putn(n) 30 if n <= 0 { ff_puts(" FETCH-FAIL\n" as *u8); return 0 } 31 var gz: i64 = 0 32 if n >= 2 { if out[0] == 0x1f as u8 { if out[1] == 0x8b as u8 { gz = 1 } } } 33 if gz == 1 { ff_puts(" [GZIP-skip]\n" as *u8); return 0 } 34 let fd: i64 = sys_openat_wr(opath, 0x1a4) 35 if fd < 0 { ff_puts(" SAVE-FAIL\n" as *u8); return 0 } 36 sys_write(fd, out, n); sys_close(fd) 37 ff_puts(" SAVED\n" as *u8) 38 return 1 39} 40 41func main() -> i64 { 42 let r: i64 = nx_trust_store_load_from_certdata("data/mozilla_certdata.txt" as *u8, 512, K_MAGIC_4194304) 43 if r <= 0 { ff_puts("AW: certdata load failed\n" as *u8); return 1 } 44 let store: *TrustStore = r as *TrustStore 45 ff_puts("CA roots=" as *u8); ff_putn(trust_store_count(store)); ff_puts("\n" as *u8) 46 let cap: i64 = K_MAGIC_8388608 47 let out: *u8 = sys_mmap(cap) 48 var ok: i64 = 0 49 50 ff_puts("== AWARD PROGRAMS / JUDGING (creativity + craft bar) ==\n" as *u8) 51 ok = ok + fetch_save("https://en.wikipedia.org/wiki/Awwwards" as *u8, "knowledge/fetched/aw_awwwards.raw" as *u8, store, out, cap) 52 ok = ok + fetch_save("https://en.wikipedia.org/wiki/Webby_Award" as *u8, "knowledge/fetched/aw_webby.raw" as *u8, store, out, cap) 53 54 ff_puts("== ART DIRECTION / VISUAL CRAFT ==\n" as *u8) 55 ok = ok + fetch_save("https://en.wikipedia.org/wiki/Art_director" as *u8, "knowledge/fetched/aw_artdirection.raw" as *u8, store, out, cap) 56 ok = ok + fetch_save("https://en.wikipedia.org/wiki/Visual_hierarchy" as *u8, "knowledge/fetched/aw_visual_hierarchy.raw" as *u8, store, out, cap) 57 ok = ok + fetch_save("https://en.wikipedia.org/wiki/Gestalt_psychology" as *u8, "knowledge/fetched/aw_gestalt.raw" as *u8, store, out, cap) 58 ok = ok + fetch_save("https://en.wikipedia.org/wiki/Grid_(graphic_design)" as *u8, "knowledge/fetched/aw_grid.raw" as *u8, store, out, cap) 59 ok = ok + fetch_save("https://en.wikipedia.org/wiki/Golden_ratio" as *u8, "knowledge/fetched/aw_golden_ratio.raw" as *u8, store, out, cap) 60 61 ff_puts("== MOTION / INTERACTION (the 'wow' layer) ==\n" as *u8) 62 ok = ok + fetch_save("https://en.wikipedia.org/wiki/Motion_graphic_design" as *u8, "knowledge/fetched/aw_motion.raw" as *u8, store, out, cap) 63 ok = ok + fetch_save("https://en.wikipedia.org/wiki/Parallax_scrolling" as *u8, "knowledge/fetched/aw_parallax.raw" as *u8, store, out, cap) 64 ok = ok + fetch_save("https://en.wikipedia.org/wiki/Web_animation" as *u8, "knowledge/fetched/aw_webanim.raw" as *u8, store, out, cap) 65 66 ff_puts("== DESIGN MOVEMENTS / EXPRESSION ==\n" as *u8) 67 ok = ok + fetch_save("https://en.wikipedia.org/wiki/Brutalist_web_design" as *u8, "knowledge/fetched/aw_brutalism.raw" as *u8, store, out, cap) 68 ok = ok + fetch_save("https://en.wikipedia.org/wiki/Swiss_Style_(design)" as *u8, "knowledge/fetched/aw_swiss.raw" as *u8, store, out, cap) 69 ok = ok + fetch_save("https://en.wikipedia.org/wiki/Design_thinking" as *u8, "knowledge/fetched/aw_design_thinking.raw" as *u8, store, out, cap) 70 71 ff_puts("== DESIGN RULES / RUBRIC GROUNDING ==\n" as *u8) 72 ok = ok + fetch_save("https://en.wikipedia.org/wiki/Composition_(visual_arts)" as *u8, "knowledge/fetched/aw_composition.raw" as *u8, store, out, cap) 73 ok = ok + fetch_save("https://en.wikipedia.org/wiki/Rule_of_thirds" as *u8, "knowledge/fetched/aw_rule_of_thirds.raw" as *u8, store, out, cap) 74 ok = ok + fetch_save("https://en.wikipedia.org/wiki/Heuristic_evaluation" as *u8, "knowledge/fetched/aw_heuristics.raw" as *u8, store, out, cap) 75 ok = ok + fetch_save("https://en.wikipedia.org/wiki/Contrast_(vision)" as *u8, "knowledge/fetched/aw_contrast.raw" as *u8, store, out, cap) 76 77 ff_puts("== A11Y INDUSTRY BENCHMARK (for a MEASURED exceed on the axis award sites fail) ==\n" as *u8) 78 ok = ok + fetch_save("https://webaim.org/projects/million/" as *u8, "knowledge/fetched/aw_webaim_million.raw" as *u8, store, out, cap) 79 ok = ok + fetch_save("https://en.wikipedia.org/wiki/Web_accessibility" as *u8, "knowledge/fetched/aw_web_accessibility.raw" as *u8, store, out, cap) 80 ok = ok + fetch_save("https://en.wikipedia.org/wiki/WebAIM" as *u8, "knowledge/fetched/aw_webaim.raw" as *u8, store, out, cap) 81 82 ff_puts("== TOTAL SAVED/HAVE = " as *u8); ff_putn(ok); ff_puts(" ==\n" as *u8) 83 return 0 84}