Files
pictshare/rtfm/INTEGRATIONS.md
2020-01-13 01:01:56 +01:00

1.3 KiB

Integrating PictShare in other programs

Upload from CLI

Requirements:

  • curl (apt-get install curl)
  • jq (apt-get install jq)
#!/bin/bash
# filename: pictshare.sh
# usage: ./pictshare.sh /path/to/image.jpg

result=$(curl -s -F "file=@${1}" https://pictshare.net/api/upload.php | jq -r .url)
echo $result

Screenshot to pictshare (linux)

This script will create a screenshot (you can choose the area), uploads it to PictShare, copies the raw image to your clipborad and opens the image on PictShare in Chrome

Requirements:

  • curl (apt-get install curl)
  • jq (apt-get install jq)
  • screenshooter (apt-get install xfce4-screenshooter)
#!/bin/bash
# filename: screenshot2pictshare.sh
# usage: ./screenshot2pictshare.sh

if [[ $# -eq 0 ]] ; then
    xfce4-screenshooter -r -o $0
    exit 0
fi

result=$(curl -s -F "file=@${1}" https://pictshare.net/api/upload.php | jq -r .url)

xclip -selection clipboard -t image/png -i $1
google-chrome $result