From 48cf65591771361ded66032cc2ae072b1bb3647c Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Mon, 6 Jul 2020 11:05:17 +0200 Subject: [PATCH] Update desktop utility instructions --- views/desktop-utility.njk | 88 ++++++++++++++++++++++++++------------- 1 file changed, 58 insertions(+), 30 deletions(-) diff --git a/views/desktop-utility.njk b/views/desktop-utility.njk index 3c2a975..f784a5f 100644 --- a/views/desktop-utility.njk +++ b/views/desktop-utility.njk @@ -7,13 +7,33 @@

First alternative: sh script (native on linux)

-

If you have the sh shell on your machine (i.e. you are on linux, git bash on windows...), you can - download this script.

+

If you have the sh shell on your machine (i.e. you are on linux, git bash on windows...) and curl, you can + download and use these scripts:

+ + + + + + + + + + + + + + + + + +
NameDownload link
upload_file.shDownload
shorten_url.shDownload

You must put a valid auth token (generated in the form at the bottom of this page) in a .ily_token - file in your home directory ($HOME/.ily_token).

+ file in your home directory ($HOME/.ily_token).

Examples:

-
upload_script.sh path/to/file
-
upload_script.sh path/to/file my_very_important_file.png
+
upload_file.sh path/to/file
+
upload_file.sh path/to/file my_very_important_file.png
+
shorten_url.sh https://gitlab.com/ArisuOngaku/ilyli
+
shorten_url.sh https://gitlab.com/ArisuOngaku/ilyli repo

@@ -34,44 +54,52 @@ Field name Description - Optional? - Example + Required? + Value(s) - upload - The file field - No - - + File upload + + + type + Request type + Yes + file + + + upload + File field + Yes + The actual file contents - ttl How much time (in seconds) to keep the file - Yes + No 0 (never delete), 30 (delete after 30s) + + + URL shorten + + + type + Request type + Yes + url + + + target_url + Target url + Yes + A valid URL starting with https:// or http:// + -

Example with curl:

-
curl -X POST -H 'Accept: application/json' \
--H "Authorization: very_secret_and_personal_token" \
--F 'type=file' \
--F 'upload=@path/to/local/file' \
-https://ily.li/
-
curl -X PUT -H 'Accept: application/json' \
--H "Authorization: very_secret_and_personal_token" \
--F 'type=file' \
--F 'upload=@path/to/local/file' \
-https://ily.li/my_very_important_file.png
-
curl -X POST -H 'Accept: application/json' \
--H "Authorization: very_secret_and_personal_token" \
--F 'type=file' \
--F 'upload=@path/to/local/file' \
--F 'ttl=30' \
-https://ily.li/
+

For examples with curl, please download and review the scripts above.