include(config.m4)dnl #!__CMD_AWK__ -f # __CGIPATH__/debug # # Show HTTP headers from curl fetching a URL # # __CGIPATH__/links # # Show download links, plus links scraped from HTML document # # __CGIPATH__/raw # # Show raw bytes from binary document # # __CGIPATH__/text # # Show text content scraped from HTML document include(src/config.awk) incl(src/api.awk) incl(src/cgi.awk) incl(src/util.awk) incl(src/web.awk) function main() { if (path == "/debug") { dump(search, TYPE_HEADERS) } else if (path == "/raw") { dump(search, TYPE_RAW) } else if (path == "/text") { dump(search, TYPE_TEXT) } else if (path == "/links") { dump(search, TYPE_LINKS) } exit 0 } BEGIN { config_init() cgi_init() uri_encode_init() web_init() main() }