aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscuttle13
1 files changed, 8 insertions, 5 deletions
diff --git a/scuttle b/scuttle
index cb94ae1..9c2d9fa 100755
--- a/scuttle
+++ b/scuttle
@@ -39,13 +39,14 @@ fi
source "$HOME/.custom/scuttle" || exit 1
# See http://www.wired.com/2010/02/using_the_delicious_api/
-CALL="$SCUTTLE_URL/api/posts/add?url=`urlencode $URL`"
+#CALL="$SCUTTLE_URL/api/posts/add?url=`urlencode $URL`"
+CALL="$SCUTTLE_URL/api/posts/add"
# Tags
TAGS="`echo $TAGS | sed -e 's/,/ /g'`"
-TAGS="`urlencode "$TAGS"`"
+#TAGS="`urlencode "$TAGS"`"
TAGS="`echo $TAGS | sed -e 's/%2C/,/g'`"
-CALL="$CALL&tags=$TAGS"
+#CALL="$CALL&tags=$TAGS"
# Description
if [ -z "$DESC" ]; then
@@ -55,7 +56,7 @@ if [ -z "$DESC" ]; then
fi
# Full API call
-CALL="$CALL&description=`urlencode "$DESC"`"
+#CALL="$CALL&description=`urlencode "$DESC"`"
# Write config
CONF="`mktemp -t scuttle.XXXXXXXXXX -p $TMP`"
@@ -63,7 +64,9 @@ echo "url = $CALL" > $CONF
echo "user = $SCUTTLE_USER:$SCUTTLE_PASS" >> $CONF
# Call curl
-curl -s -K $CONF &> /dev/null
+# See https://stackoverflow.com/questions/296536/how-to-urlencode-data-for-curl-command#2027690
+#curl -s -K $CONF &> /dev/null
+curl -s -K $CONF -G --data-urlencode "url=$URL" --data-urlencode "tags=$TAGS" --data-urlencode "description=$DESC" &> /dev/null
# Status
STATUS="$?"