mirror of
http://gitea.phreedom.club/localhost_frssoft/pleroma-cli
synced 2024-11-24 10:31:28 +00:00
Added: Share + favorite function
This commit is contained in:
parent
0060e6282d
commit
311a4e7dea
|
@ -365,7 +365,7 @@ statuses_view_menu()
|
|||
ids_massive=$(echo $json | jj -l \#.id | delq)
|
||||
jsonmassive=$json
|
||||
statuses_render
|
||||
menustatuses=$(echo 'Prev\nNext\nReply\nShare\nFavorite\nThread\nBack' | fzy)
|
||||
menustatuses=$(echo 'Prev\nNext\nReply\nShare\nFavorite\nShare and favorite\nThread\nBack' | fzy)
|
||||
case "$menustatuses" in
|
||||
"Back") sub_menu_lvl=1 ;;
|
||||
"Prev")
|
||||
|
@ -384,6 +384,7 @@ statuses_view_menu()
|
|||
"Reply") reply_mode ;;
|
||||
"Share") share_mode ;;
|
||||
"Favorite") favourite_mode ;;
|
||||
"Share and favorite") share_and_favorite_mode ;;
|
||||
"Thread") thread_open ;;
|
||||
esac
|
||||
done
|
||||
|
@ -415,12 +416,13 @@ thread_menu()
|
|||
ids_massive=$(echo $jsonthread | jj -l \#.id | delq)
|
||||
jsonmassive=$jsonthread
|
||||
statuses_render
|
||||
menuthread=$(echo 'Back\nReply\nShare\nFavorite' | fzy)
|
||||
menuthread=$(echo 'Back\nReply\nShare\nFavorite\nShare and favorite' | fzy)
|
||||
case "$menuthread" in
|
||||
"Back") sub_menu_lvl=1 ;;
|
||||
"Reply") reply_mode ;;
|
||||
"Share") share_mode ;;
|
||||
"Favorite") favourite_mode ;;
|
||||
"Share and favorite") share_and_favorite_mode ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
@ -439,7 +441,7 @@ timeline_menu()
|
|||
ids_massive=$(echo $json | jj -l \#.id | delq)
|
||||
jsonmassive=$json
|
||||
statuses_render
|
||||
menu=$(echo 'Prev\nNext\nReply\nShare\nFavorite\nThread\nMain menu' | fzy)
|
||||
menu=$(echo 'Prev\nNext\nReply\nShare\nFavorite\nShare and favorite\nThread\nMain menu' | fzy)
|
||||
case $menu in
|
||||
"Prev")
|
||||
indexator=$(expr $max_statuses - 1)
|
||||
|
@ -457,6 +459,7 @@ timeline_menu()
|
|||
"Reply") reply_mode ;;
|
||||
"Share") share_mode ;;
|
||||
"Favorite") favourite_mode ;;
|
||||
"Share and favorite") share_and_favorite_mode ;;
|
||||
"Thread") thread_open ;;
|
||||
"Main menu") sub_menu_lvl=0 ;;
|
||||
esac
|
||||
|
@ -473,6 +476,23 @@ reply_mode()
|
|||
write_status_menu $status_id
|
||||
}
|
||||
|
||||
share_and_favorite_mode()
|
||||
{
|
||||
echo 'Input id (s - stop)'
|
||||
shareandfavmode=1
|
||||
while [ $shareandfavmode -eq 1 ]; do
|
||||
read status_id
|
||||
if [ "$status_id" = 's' ]; then
|
||||
shareandfavmode=0
|
||||
else
|
||||
share_api_status $status_id
|
||||
echo $http_code
|
||||
favorite_api_status $status_id
|
||||
echo $http_code
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
share_api_status()
|
||||
{
|
||||
post_request -w "%{http_code}" --url $instance_point/statuses/$1/reblog --output /dev/null
|
||||
|
|
Loading…
Reference in a new issue