Using GNU awkAWK (HTTP only):
echo 'http://bitly.is/urlshortening' |
  awk ''BEGIN{
        ORS="\r\n"   # end printed lines with CRLF
        IGNORECASE=1 # header names vary in capitalization
       }
  (gsub(/^http:\/\//,"")==0){ print "unable to use " $0; next }                                                                                                   
  { domain = gensub(/\/.*$/,"","g")   # e.g. bitly.is
    path = gensub(/^[^/]*\//,"/","g") # e.g. /urlshortening
    http_connection = "/inet/tcp/0/" domain "/80"
    print "GET"HEAD " path " HTTP/1.1" |& http_connection
    print "Host: " domain |& http_connection
    print "Connection: close\n\n"close\n" |& http_connection
    while ((http_connection |& getline) > 0)
      if(gsub(/^Location: /,"") > 0)
        print
  }'
 This submits  a  GETHEAD request based on. I got the templateidea from this question on CodeGolf: https://codegolf.stackexchange.com/questions/61836/the-worlds-smallest-web-browser
 This only works for link shortening services that support just HTTP (but I checked, and both bitly.is and tinyurl allow it!). There's probably a way to do HTTPS too (use /443 and...encrypt it somehow), but my knowledge doesn't go that far.
 
                