favorite support added

This commit is contained in:
localhost_frssoft 2022-04-14 17:26:06 +03:00
parent 5e47e1677c
commit 3cdfdf4cf7

View file

@ -345,7 +345,7 @@ timeline_menu()
indexator=$(expr $indexator - 1)
echo '_____'
done
menu=$(echo 'Prev\nNext\nReply\nShare\nThread\nMain menu' | fzy)
menu=$(echo 'Prev\nNext\nReply\nShare\nFavorite\nThread\nMain menu' | fzy)
case $menu in
"Prev")
indexator=$(expr $max_statuses - 1)
@ -380,6 +380,19 @@ timeline_menu()
fi
done
;;
"Favorite")
echo 'Input id (s - stop)'
favoritemode=1
while [ $favoritemode -eq 1 ]; do
read status_id
if [ "$status_id" = 's' ]; then
favoritemode=0
else
favorite_api_status $status_id
echo $http_code
fi
done
;;
"Thread")
indexator=$(expr $max_statuses - 1)
echo 'Input id'
@ -398,6 +411,11 @@ share_api_status()
post_request -w "%{http_code}" --url $instance_point/statuses/$1/reblog --output /dev/null
}
favorite_api_status()
{
post_request -w "%{http_code}" --url $instance_point/statuses/$1/favourite --output /dev/null
}
write_api_status()
{
if [ -n "$mediaattach" ]; then