notes/wget msgboard script-RTUpRrre.sh
#!/bin/bash
url="<url>"
key="<key>"
user="<user name>"
if [ "$1" = "help" ]
then
echo "To read message board:"
echo "$0"
echo ""
echo "To post a message:"
echo "$0 'Hello World'"
exit 1
fi
if [ $# -lt 1 ];
then
curl -s "${url}?key=${key}&user=${user}"|grep -v -e '^<' -e '^ '
else
msg="$(echo $*|sed 's/ /%20/g')"
curl -s "${url}?key=${key}&user=${user}&msg=${msg}"
curl -s "${url}?key=${key}&user=${user}"|grep -v -e '^<' -e '^ '
fi
syntax highlighted by Code2HTML, v. 0.9.1