Skip to content

Commit

Permalink
.functions: Add gurl function for gzip-enabled curl
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasbynens committed Mar 15, 2012
1 parent 1de8cb8 commit e29deab
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .functions
Expand Up @@ -18,6 +18,11 @@ function httpcompression() {
encoding="$(curl -LIs -H 'User-Agent: Mozilla/5 Gecko' -H 'Accept-Encoding: gzip,deflate,compress,sdch' "$1" | grep '^Content-Encoding:')" && echo "$1 is encoded using ${encoding#* }" || echo "$1 is not using any encoding"
}

# Gzip-enabled `curl`
function gurl() {
curl -sH "Accept-Encoding: gzip" "$@" | gunzip
}

# Syntax-highlight JSON strings or files
function json() {
if [ -p /dev/stdin ]; then
Expand Down

0 comments on commit e29deab

Please sign in to comment.