mirror of
http://gitea.phreedom.club/localhost_frssoft/pleroma-cli
synced 2024-11-25 21:21:26 +00:00
Compare commits
2 commits
2536388308
...
bfdce6ecf0
Author | SHA1 | Date | |
---|---|---|---|
localhost_frssoft | bfdce6ecf0 | ||
localhost_frssoft | 4d0535fa09 |
128
pleroma-cli.sh
128
pleroma-cli.sh
|
@ -258,19 +258,19 @@ mutes_api_export()
|
|||
follow_api_import()
|
||||
{
|
||||
post_request "$instance_point_pleroma/follow_import" \
|
||||
--data 'list=@restore/friends.csv'
|
||||
--form 'list=@restore/friends.csv'
|
||||
}
|
||||
|
||||
blocks_api_import()
|
||||
{
|
||||
post_request "$instance_point_pleroma/blocks_import" \
|
||||
--data 'list=@restore/blocks.csv'
|
||||
--form 'list=@restore/blocks.csv'
|
||||
}
|
||||
|
||||
mutes_api_import()
|
||||
{
|
||||
post_request "$instance_point_pleroma/mutes_import" \
|
||||
--data 'list=@restore/mutes.csv'
|
||||
--form 'list=@restore/mutes.csv'
|
||||
}
|
||||
#[MIGRATION SECTION END]
|
||||
|
||||
|
@ -454,7 +454,7 @@ statuses_render()
|
|||
echo '[NSFW]'
|
||||
fi
|
||||
echo "$status" | jj -r content | delqse | html_to_txt_render
|
||||
attachments=$(echo "$status" | jj -l media_attachments.#.remote_url | delq)
|
||||
attachments=$(echo "$status" | jj -l 'media_attachments.#.remote_url' | delq)
|
||||
menuattachments=
|
||||
if [ -n "$attachments" ]; then
|
||||
echo "#EXTINF:-1, $uri" >> attachments.m3u8
|
||||
|
@ -469,18 +469,24 @@ statuses_render()
|
|||
while [ "$next" -eq 0 ]; do
|
||||
per_status_menu=$(echo "Next$menuattachments"$s_f_menu"\nFavorite\nBookmark\nReply\nBack" | fzy)
|
||||
case "$per_status_menu" in
|
||||
"Next") next=1; clear ;;
|
||||
"Next")
|
||||
next=1
|
||||
clear
|
||||
;;
|
||||
"Media")
|
||||
for one_media in $attachments; do
|
||||
mpv "$one_media"
|
||||
done
|
||||
;;
|
||||
for one_media in $attachments; do
|
||||
mpv "$one_media"
|
||||
done
|
||||
;;
|
||||
"Share and favorite") share_and_favorite_mode "$id_status" ;;
|
||||
"Share") share_api_status "$id_status" ;;
|
||||
"Favorite") favorite_api_status "$id_status" ;;
|
||||
"Bookmark") bookmark_api_status "$id_status" ;;
|
||||
"Reply") reply_mode "$id_status" ;;
|
||||
"Back") next=1; force_stop=1 ;;
|
||||
"Back")
|
||||
next=1
|
||||
force_stop=1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
if [ "$force_stop" -eq 1 ]; then break; fi
|
||||
|
@ -856,58 +862,60 @@ switchinstance='Switch instance'
|
|||
Exit='Exit'
|
||||
|
||||
while true; do
|
||||
if [ -n "$auth" ]; then
|
||||
main_menu=$(echo "$menu_write_status\n$menu_timeline\n$notif\n$my_account\n$switchinstance\n$Exit" | fzy)
|
||||
else
|
||||
main_menu=$(echo "$authmake\n$menu_timeline\n$switchinstance\n$Exit" | fzy)
|
||||
fi
|
||||
case $main_menu in
|
||||
"$menu_write_status") write_status_menu ;;
|
||||
"$menu_timeline")
|
||||
timeline=$(echo 'home\nhome/local\nfavourites\nbookmarks\ndirect\nlocal\npublic' | fzy)
|
||||
timeline_menu
|
||||
;;
|
||||
"$notif") notif_menu ;;
|
||||
"$my_account")
|
||||
my_account_menu=$(echo "$followingsmenu\n$followrequests\n$backup_restore" | fzy)
|
||||
case $my_account_menu in
|
||||
"$followingsmenu") followings_menu ;;
|
||||
"$followrequests") menu_follow_requests ;;
|
||||
"$backup_restore") backup_restore_menu ;;
|
||||
esac
|
||||
;;
|
||||
if [ -n "$auth" ]; then
|
||||
main_menu=$(echo "$menu_write_status\n$menu_timeline\n$notif\n$my_account\n$switchinstance\n$Exit" | fzy)
|
||||
else
|
||||
main_menu=$(echo "$authmake\n$menu_timeline\n$switchinstance\n$Exit" | fzy)
|
||||
fi
|
||||
case $main_menu in
|
||||
"$menu_write_status") write_status_menu ;;
|
||||
"$menu_timeline")
|
||||
timeline=$(echo 'home\nhome/local\nfavourites\nbookmarks\ndirect\nlocal\npublic' | fzy)
|
||||
timeline_menu
|
||||
;;
|
||||
"$notif") notif_menu ;;
|
||||
"$my_account")
|
||||
my_account_menu=$(echo "$followingsmenu\n$followrequests\n$backup_restore" | fzy)
|
||||
case $my_account_menu in
|
||||
"$followingsmenu") followings_menu ;;
|
||||
"$followrequests") menu_follow_requests ;;
|
||||
"$backup_restore") backup_restore_menu ;;
|
||||
esac
|
||||
;;
|
||||
|
||||
"$switchinstance")
|
||||
empty=0
|
||||
case $(echo 'Recently used\nChoice from list\nManual input' | fzy) in
|
||||
"Recently used")
|
||||
if [ -s $instance_hist ]; then
|
||||
touch $instance_hist && instance=$(cat $instance_hist | fzy)
|
||||
else
|
||||
echo 'No recently used instances...'
|
||||
empty=1
|
||||
fi ;;
|
||||
"$switchinstance")
|
||||
empty=0
|
||||
case $(echo 'Recently used\nChoice from list\nManual input' | fzy) in
|
||||
"Recently used")
|
||||
if [ -s $instance_hist ]; then
|
||||
touch $instance_hist && instance=$(cat $instance_hist | fzy)
|
||||
else
|
||||
echo 'No recently used instances...'
|
||||
empty=1
|
||||
fi
|
||||
;;
|
||||
|
||||
"Choice from list") instance=$(jj -l -i config.json public_list_instances | sed 's/"//g' | fzy) ;;
|
||||
"Choice from list") instance=$(jj -l -i config.json public_list_instances | sed 's/"//g' | fzy) ;;
|
||||
|
||||
"Manual input") echo "Type instance (ex. $instance):" && read instance ;;
|
||||
"Manual input") echo "Type instance (ex. $instance):" && read instance ;;
|
||||
esac
|
||||
if [ $empty -eq 0 ]; then
|
||||
echo "$instance" >> $instance_hist
|
||||
cat $instance_hist | sort | uniq | tee $instance_hist 1>>/dev/null
|
||||
proxy_init
|
||||
instance_point="$default_connect_protocol://$instance/api/v1"
|
||||
instance_point_pleroma="$default_connect_protocol://$instance/api/pleroma"
|
||||
conf_instance_state=$(echo 'Permanent\nTemporaly' | fzy)
|
||||
if [ "$conf_instance_state" = 'Permanent' ]; then
|
||||
jj -i config.json instance -v "$instance" -o config.json
|
||||
else
|
||||
echo ''
|
||||
fi
|
||||
clear
|
||||
make_login
|
||||
fi
|
||||
;;
|
||||
"$authmake") auth_api_get_token ;;
|
||||
"$Exit") exit 0 ;;
|
||||
esac
|
||||
if [ $empty -eq 0 ]; then
|
||||
echo "$instance" >> $instance_hist
|
||||
cat $instance_hist | sort | uniq | tee $instance_hist 1>>/dev/null
|
||||
proxy_init
|
||||
instance_point="$default_connect_protocol://$instance/api/v1"
|
||||
instance_point_pleroma="$default_connect_protocol://$instance/api/pleroma"
|
||||
conf_instance_state=$(echo 'Permanent\nTemporaly' | fzy)
|
||||
if [ "$conf_instance_state" = 'Permanent' ]; then
|
||||
jj -i config.json instance -v "$instance" -o config.json
|
||||
else
|
||||
echo ''
|
||||
fi
|
||||
clear
|
||||
make_login
|
||||
fi ;;
|
||||
"$authmake") auth_api_get_token ;;
|
||||
"$Exit") exit 0 ;;
|
||||
esac
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue