Skip to content

Instantly share code, notes, and snippets.

@2bj
Created July 7, 2009 20:42
Show Gist options
  • Save 2bj/142355 to your computer and use it in GitHub Desktop.
Save 2bj/142355 to your computer and use it in GitHub Desktop.
bash implementation of pump.kg
#!/usr/bin/env bash
# bash implementation of pump.kg
# @author 2bj (gml2bj gmail)
# TODO:
# * check download status
# * get download url
# * add url's from file (bulk add)
if [ $# -eq 0 ]; then
echo "pls, give me url"
exit 1
fi
URL=$1
DESCR=$2
RESULT=`curl -s -d link[url]="$URL" -d link[description]="$DESCR" http://pump.kg/links`
if [[ $RESULT == *redirected* ]]; then
echo " - your url added; (http://pump.kg/links)"
exit 0
else
echo " - oops, error;"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment