Skip to content

Instantly share code, notes, and snippets.

@prenagha
Created March 2, 2020 02:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prenagha/f9a045657a0cf72b9077223015ace28f to your computer and use it in GitHub Desktop.
Save prenagha/f9a045657a0cf72b9077223015ace28f to your computer and use it in GitHub Desktop.
Add Link to Raindrop
#!/usr/local/bin/bash
URL="$1"
if [ -f "${URL}" ]
then
URL=`cat ${URL}`
fi
/usr/bin/curl --fail --silent \
--data "{ \"link\": \"${URL}\", \"collection\": { \"\$ref\":\"collections\", \"\$id\": 111 }}" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer zzz" \
https://api.raindrop.io/rest/v1/raindrop 1>/dev/null
if [ $? -ne 0 ]
then
echo "curl error adding raindrop $URL"
exit 2
fi
echo "OK"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment