Remove HTTP headers from gzip or zip on stdin yy054 (revised)
.
/* remove HTTP headers from multiple gzip or single zip from stdin */
int fileno (FILE *);
int setenv (const char *, const char *, int);
#define jmp (yy_start) = 1 + 2 *
int show_headers;
%option nounput noinput noyywrap
%%
HTTP\/[01]\.[\15\12\40-\176]{0,1024}\r\n\r\n if(show_headers){fwrite(yytext,1,yyleng,yyout);putc(10,yyout);};
.|\n if(!show_headers)fwrite(yytext,1,yyleng,yyout);
%%
int main(int argc,char *argv[])
{
if(argc)if(argv[0])
if(argv[1])show_headers++;
yylex();
exit(0);
}
2 comments
[ 3.3 ms ] story [ 15.4 ms ] threadDownload NetBSD 1.0 in a single TCP connection.
Alternate usage:Include an argv[1] will print HTTP headers only
Retrieve hostnames, IP addresses and (if available) sitemap URLs from latest Common Crawl.