Browse files

.functions: Add `gurl` function for gzip-enabled `curl`

  • Loading branch information...
1 parent bc055c2 commit 1b3ed7a646de7a652f0596985af976a438e32aca @mathiasbynens committed Mar 15, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 .functions
View
5 .functions
@@ -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

0 comments on commit 1b3ed7a

Please sign in to comment.