#!/bin/sh
if [ $# -gt 0 ]; then
lang="$1"
else
lang="Plain+Text"
fi
data="lang=$lang&code="$(od -t x1 -An | sed 's/ /%/g' | tr -d '\n')"&run=True&submit=Submit"
nc.traditional -q -1 codepad.org 80 << EOF | sed -n 's/Location: //p'
POST / HTTP/1.1
Host: codepad.org
Referer: http://codepad.org
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: $(echo "$data" | tr -d '\\' | wc -c)
$data
EOF