3
3
3err02014-08-10 11:26:43
API
3err0, 2014-08-10 11:26:43

Is there a screenshoter with uploading to a third-party API?

Good time.
There was a need for an application for Windows that can take screenshots with the ability to upload it to a third-party image service API specified in it. On a Linux system, everything is much simpler, for this a script was written for subsequent unloading

#!/bin/bash

URL='http://service.ru'
NAME=`date '+%d-%m-%y-%N'`
DIR="/tmp"
FILE="$DIR/$NAME.jpg"
REMOVE=1 #Remove image after upload

function uploadImage {
  curl -s -F "[email protected]$FILE" $URL/upload | grep -E -o $URL'[^"}]*'
}

scrot -s $FILE
uploadImage $FILE | xclip -selection c
if [ $REMOVE == 1 ]; then
  rm $FILE
fi
notify-send -t 5000 -i dialog-information "Screenshot uploaded" "And copied from Clipboard"

Therefore, the question arose whether it is possible to implement this in the Win system by writing any of the scripts, or any of the applications.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Taratin, 2014-08-10
@3err0

ducklink.com/free-command-line-screen-capture.php + curl + small bat file + windows.microsoft.com/ru-ru/windows/create-keyboar...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question