Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
wget --header='Accept-encoding: identity' -O $DIR/tt.html [URL unfurl="true"]http://www.espncricinfo.com/ci/content/records/223646.html[/URL]
wget -O $DIR/tt.html.gz [URL unfurl="true"]http://www.espncricinfo.com/ci/content/records/223646.html[/URL]
gunzip $DIR/tt.html.gz
[tt]Accept[/tt] says what [tt]Content-type[/tt] the user agent accepts.Arun said:In the first option, wouldn't using...
--header='Accept: text/html'
ensure that i get a plain html file every time?
You have two options :Arun said:how can I test if the file is gzipped
[highlight][navy]enc[/navy][teal]=[/teal][green][i]"$([/i][/green][/highlight] [green][i]wget [highlight]-S[/highlight] -O $DIR/tt.html [URL unfurl="true"]http://www.espncricinfo.com/ci/content/records/223646.html[/URL][/i][/green] [highlight][green][i]2>&1 | grep -i 'content-encoding' )"[/i][/green][/highlight]
[highlight]expr [green][i]"$enc"[/i][/green] [teal]:[/teal] [green][i]'.*gzipx'[/i][/green] [teal]>[/teal] /dev/null[/highlight] [teal]&&[/teal] {
mv tt[teal].[/teal]html tt[teal].[/teal]html[teal].[/teal]gz
gunzip tt[teal].[/teal]html[teal].[/teal]gz
}
wget -O [navy]$DIR[/navy]/tt[teal].[/teal]html http[teal]:[/teal]//www[teal].[/teal]espncricinfo[teal].[/teal]com/ci/content/records[teal]/[/teal][purple]223646[/purple][teal].[/teal]html
[highlight][navy]enc[/navy][teal]=[/teal][green][i]"$( "[/i][/green]file [navy]$DIR[/navy]/tt[teal].[/teal]html[green][i]" )"[/i][/green][/highlight]
[highlight]expr [green][i]"$enc"[/i][/green] [teal]:[/teal] [green][i]'.*gzipx'[/i][/green] [teal]>[/teal] /dev/null[/highlight] [teal]&&[/teal] {
mv tt[teal].[/teal]html tt[teal].[/teal]html[teal].[/teal]gz
gunzip tt[teal].[/teal]html[teal].[/teal]gz
}
curl -L -o $DIR/tt.html [URL unfurl="true"]http://www.espncricinfo.com/ci/content/records/223646.html[/URL]
[navy]enc[/navy][teal]=[/teal][green][i]"$( wget -S -O $DIR/tt.html [URL unfurl="true"]http://www.espncricinfo.com/ci/content/records/223646.html[/URL] 2>&1 | [highlight]sed -n '/HTTP.* 200 *OK/I,${/Content-encoding/Ip}'[/highlight] )"[/i][/green]
expr [green][i]"$enc"[/i][/green] [teal]:[/teal] [green][i]'.*gzip'[/i][/green] [teal]>[/teal] /dev/null [teal]&&[/teal] {
mv tt[teal].[/teal]html tt[teal].[/teal]html[teal].[/teal]gz
gunzip tt[teal].[/teal]html[teal].[/teal]gz
}