Created
March 2, 2020 02:45
-
-
Save prenagha/f9a045657a0cf72b9077223015ace28f to your computer and use it in GitHub Desktop.
Add Link to Raindrop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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