summaryrefslogtreecommitdiff
path: root/contrib/bookmark-pinboard.sh
blob: 8d5c86a5cf4dc3a5746cdf5852d8129a34600e73 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
# newsbeuter bookmarking plugin for pinboard
# (c) 2007 Andreas Krennmair
# documentation: https://pinboard.in/api

username="pinboard_username"
password="pinboard_password"

# You can enter up to 100 tags here, space delimited, or leave blank for no tag
tags="via:newsbeuter"

# Leave as 'yes' to bookmark as to be read, enter 'no' to mark as read
toread="yes"

url="$1"
title="$2"
desc="$3"

pinboard_url="https://api.pinboard.in/v1/posts/add?url=${url}&description=${title}&extended=${desc}&tags="${tags}"&toread=${toread}"

output=`wget --http-user=$username --http-passwd=$password -O - "$pinboard_url" 2> /dev/null`

output=`echo $output | sed 's/^.*code="\([^"]*\)".*$/\1/'`

if [ "$output" != "done" ] ; then
  echo "$output"
fi