โ€ƒ 

๐Ÿ›– ๐Ÿง”๐Ÿปโ€โ™€๏ธ ๐Ÿš’ ๐Ÿฉบ ๐ŸฆŒ ๐Ÿฅกโ€„๐Ÿฅ”

3364 posts 41 followers 45 following

“Listen, I've got something very obvious to tell you. You’re not allowed to give up. If they decide to kill me, it means that we are incredibly strong.”

- Alexei Navalny


Reposted from 1911s via nictupomnie

Upload random image to loforo from any folder using the loforo API

To upload random file from current working directory on Linux use a command similar to shown below, also do not forget to quote html as not doing so might cause bugs and this is just an example:

mkdir -p uploaded
FILE=$(find *.* -type f | shuf -n 1); curl -F 'key=<your api key>' -F "media=@$FILE" -F 'content="<p>some html here</p>"' https://loforo.com/api/post/create; mv -v $FILE uploaded

You can copy files you want to upload to a temporary directory by using a command below as example and run above command from there:

for arg in {1..10}; do FILE="$(find -type f|shuf -n 1|cut -d\/ -f2-)"; cp -v --backup=numbered "$FILE" /path/to/tmp/dir/; done

Replace 1..10 with amount of how many random files you want to copy (1 to <total>, e.g. 1..100 to copy 100 files), delete any non-images from such folder and anything you don't want to upload before running commands above. Read More »


Reposted from juozaspo