mirror of
http://gitea.phreedom.club/localhost_frssoft/pleroma-cli
synced 2024-11-26 13:01:28 +00:00
Compare commits
No commits in common. "5eb9853a1ca87eff42d4a3fe05141bccf82d7465" and "d721fdc833ef792da29aa335cd7067279e02dbed" have entirely different histories.
5eb9853a1c
...
d721fdc833
|
@ -60,14 +60,9 @@ make_login()
|
||||||
{
|
{
|
||||||
curl -s --compressed -X POST -H "Authorization: Bearer $auth" "$@"
|
curl -s --compressed -X POST -H "Authorization: Bearer $auth" "$@"
|
||||||
}
|
}
|
||||||
put_request()
|
|
||||||
{
|
|
||||||
curl -s --compressed -X PUT -H "Authorization: Bearer $auth" "$@"
|
|
||||||
}
|
|
||||||
echo '+Authorized account+'
|
echo '+Authorized account+'
|
||||||
export default_curl_opt
|
export default_curl_opt
|
||||||
export post_request
|
export post_request
|
||||||
export put_request
|
|
||||||
else
|
else
|
||||||
default_curl_opt()
|
default_curl_opt()
|
||||||
{
|
{
|
||||||
|
@ -909,38 +904,6 @@ notif_api_remove_all()
|
||||||
post_request --url "$instance_point"/notifications/clear
|
post_request --url "$instance_point"/notifications/clear
|
||||||
}
|
}
|
||||||
|
|
||||||
custom_manual_api_request()
|
|
||||||
{
|
|
||||||
while true; do
|
|
||||||
echo 'Select request method:'
|
|
||||||
method=$(echo 'get\npost\nput' | fzy)
|
|
||||||
echo 'Input api request: api/v1/...'
|
|
||||||
case $method in
|
|
||||||
'get')
|
|
||||||
read raw_api
|
|
||||||
default_curl_opt "https://$instance/$raw_api" | jj -p
|
|
||||||
;;
|
|
||||||
'post')
|
|
||||||
read raw_api
|
|
||||||
echo 'input curl data flags: --data-urlencode "example=example"'
|
|
||||||
read flags
|
|
||||||
post_request $flags --url "https://$instance/$raw_api" | jj -p
|
|
||||||
;;
|
|
||||||
'put')
|
|
||||||
read raw_api
|
|
||||||
echo 'input curl data flags: --data-urlencode "example=example"'
|
|
||||||
read flags
|
|
||||||
put_request $flags --url "https://$instance/$raw_api" | jj -p
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
echo "Done, exit? (y/N)"
|
|
||||||
read yn
|
|
||||||
if [ "$yn" = 'y' ]; then
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
menu_write_status='Write status'
|
menu_write_status='Write status'
|
||||||
menu_timeline='Timelines'
|
menu_timeline='Timelines'
|
||||||
notif='Notifications'
|
notif='Notifications'
|
||||||
|
@ -950,14 +913,13 @@ my_account='Account'
|
||||||
backup_restore='Backup/Restore'
|
backup_restore='Backup/Restore'
|
||||||
manage_followings='Manage followings'
|
manage_followings='Manage followings'
|
||||||
search_menu='Search'
|
search_menu='Search'
|
||||||
custom_request='Make custom api request'
|
|
||||||
authmake='Auth'
|
authmake='Auth'
|
||||||
switchinstance='Switch instance'
|
switchinstance='Switch instance'
|
||||||
Exit='Exit'
|
Exit='Exit'
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
if [ -n "$auth" ]; then
|
if [ -n "$auth" ]; then
|
||||||
main_menu=$(echo "$menu_write_status\n$menu_timeline\n$notif\n$my_account\n$search_menu\n$custom_request\n$switchinstance\n$Exit" | fzy)
|
main_menu=$(echo "$menu_write_status\n$menu_timeline\n$notif\n$my_account\n$search_menu\n$switchinstance\n$Exit" | fzy)
|
||||||
else
|
else
|
||||||
main_menu=$(echo "$authmake\n$menu_timeline\n$switchinstance\n$Exit" | fzy)
|
main_menu=$(echo "$authmake\n$menu_timeline\n$switchinstance\n$Exit" | fzy)
|
||||||
fi
|
fi
|
||||||
|
@ -987,7 +949,6 @@ while true; do
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
"$search_menu") search_api_statuses ;;
|
"$search_menu") search_api_statuses ;;
|
||||||
"$custom_request") custom_manual_api_request ;;
|
|
||||||
"$switchinstance")
|
"$switchinstance")
|
||||||
empty=0
|
empty=0
|
||||||
case $(echo 'Recently used\nChoice from list\nManual input' | fzy) in
|
case $(echo 'Recently used\nChoice from list\nManual input' | fzy) in
|
||||||
|
|
Loading…
Reference in a new issue