aboutsummaryrefslogtreecommitdiff
path: root/scuttle
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2021-02-10 20:00:59 -0300
committerSilvio Rhatto <rhatto@riseup.net>2021-02-10 20:00:59 -0300
commit9c790189ae2163631ea09618f11f9908a722dd6c (patch)
tree1278ca699a6b7682e7c6afe89763a93fc4edbdc8 /scuttle
parent167f0bfe438530e555fbcf9894d86ded3ef727af (diff)
downloadscripts-9c790189ae2163631ea09618f11f9908a722dd6c.tar.gz
scripts-9c790189ae2163631ea09618f11f9908a722dd6c.tar.bz2
Fix: scuttle: use urlencode from curl
Diffstat (limited to 'scuttle')
-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="$?"