Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
Jack L. Frost 2019-11-23 09:57:58 +03:00
parent 01478630e8
commit 3a48f36d43
1 changed files with 5 additions and 5 deletions

10
ufw
View File

@ -82,7 +82,7 @@ get_album_id() {
get_api_status <<< "$api_response"
if (( api_status == 200 )); then
album_id=$( jshon -e data -e album -e id -u <<< "$api_response" )
album_id=$( jq -r '.data.album.id' <<< "$api_response" )
misc_curl_args+=( -F album_id="$album_id" )
else
printf 'Error [album]: %s %s\n' "$api_status" "$api_status_message"
@ -162,7 +162,7 @@ upload() {
get_api_status <<< "$api_response"
if (( api_status == 200 )); then
file_link=$( jshon -e data -e "$file_url_request" -u <<< "$api_response" )
file_link=$( jq -r ".data.${file_url_request}" <<< "$api_response" )
(( flag_shortlink )) || {
(( flag_directlink )) || file_link="${file_link#*.}"
@ -188,7 +188,7 @@ get_shortlink() {
if (( api_status == 200 )); then
read -r short_url real_url < <(
jshon -e data -e short_url -u <<< "$api_response"
jq -r '.data.short_url' <<< "$api_response"
)
printf '%s\n' "$short_url"
@ -221,7 +221,7 @@ take_screenshot() {
get_api_status() {
read -d '' -r api_status api_status_message < <(
jshon -e status -e code -u -p -e message -u
jq -r '.status.code, .status.message'
)
if ! (( api_status == 200 )); then
@ -252,7 +252,7 @@ get_my_ip() {
get_api_status <<< "$api_response"
if (( api_status == 200 )); then
my_ip=$( jshon -e data -e ip -u <<< "$api_response" )
my_ip=$( jq -r '.data.ip' <<< "$api_response" )
printf '%s\n' "$my_ip"
else
printf 'Error: %s %s\n' "$api_status" "$api_status_message"