mirror of
http://gitea.phreedom.club/localhost_frssoft/pleroma-cli
synced 2024-12-01 18:46:33 +00:00
Compare commits
No commits in common. "49119c1d64f25d2523907d7821cce8d99d1ad8dd" and "7083310a416eed5e488cd98a9622ef47bdc99fde" have entirely different histories.
49119c1d64
...
7083310a41
|
@ -5,7 +5,6 @@
|
|||
"default_visibility": "unlisted",
|
||||
"format_time": "+%d.%m.%Y %H:%M:%S",
|
||||
"boost_symbol": "[>>]",
|
||||
"reversed_statuses": false,
|
||||
"public_list_instances": [
|
||||
"outerheaven.club",
|
||||
"stereophonic.space",
|
||||
|
|
|
@ -10,7 +10,6 @@ default_visibility=$(jj -i config.json default_visibility)
|
|||
default_content_type=$(jj -i config.json default_content_type)
|
||||
format_time=$(jj -i config.json format_time)
|
||||
boost_symbol=$(jj -i config.json boost_symbol)
|
||||
reversed_statuses=$(jj -i config.json reversed_statuses)
|
||||
|
||||
#[AUTH SECTION]
|
||||
mkdir -m 711 -p .app_sessions
|
||||
|
@ -304,39 +303,6 @@ statuses_api_account()
|
|||
default_curl_opt "accounts/$1/statuses?limit=$max_statuses"
|
||||
}
|
||||
|
||||
statuses_render()
|
||||
{
|
||||
if [ "$reversed_statuses" = 'true' ]; then
|
||||
ids_massive=$(echo $ids_massive | tr ' ' '\n' | tac | tr '\n' ' ')
|
||||
fi
|
||||
for i in $ids_massive; do
|
||||
status=$(echo "$jsonmassive" | jj "#[id=$i]")
|
||||
reblog=$(echo $status | jj reblog.id)
|
||||
uri=$(echo $status | jj uri)
|
||||
id_status=$(echo $status | jj id)
|
||||
dateutc=$(echo $status | jj created_at)
|
||||
reply_to_id=$(echo $status | jj in_reply_to_id)
|
||||
echo "$(date -d $dateutc "$format_time") <$id_status> $uri"
|
||||
if [ -n "$reply_to_id" ]; then
|
||||
echo "Reply to: $reply_to_id"
|
||||
fi
|
||||
if [ -n "$reblog" ]; then
|
||||
echo "$boost_symbol $reblog"
|
||||
fi
|
||||
spoiler_text=$(echo "$status" | jj spoiler_text)
|
||||
if [ -n "$spoiler_text" ]; then
|
||||
echo "#[$spoiler_text]"
|
||||
fi
|
||||
echo "$status" | jj -r content | delqse | html_to_txt_render
|
||||
attachments=$(echo $status | jj -l media_attachments.#.remote_url | delq)
|
||||
if [ -n "$attachments" ]; then
|
||||
echo "#EXTINF:-1, $uri" >> attachments.m3u8
|
||||
echo "$attachments" >> attachments.m3u8
|
||||
fi
|
||||
echo '=========='
|
||||
done
|
||||
}
|
||||
|
||||
thread_menu()
|
||||
{
|
||||
sub_menu_lvl=2
|
||||
|
@ -350,15 +316,34 @@ thread_menu()
|
|||
else
|
||||
jsonthread="$descendants"
|
||||
fi
|
||||
indexator=$(expr $(echo $jsonthread | jj \#) - 1)
|
||||
counter=0
|
||||
while [ $sub_menu_lvl -eq 2 ]; do
|
||||
clear
|
||||
echo '[Thread]'
|
||||
ids_massive=$(echo $jsonthread | jj -l \#.id | delq)
|
||||
jsonmassive=$jsonthread
|
||||
statuses_render
|
||||
while [ ! $indexator -eq $counter ]; do
|
||||
status=$(echo $jsonthread | jj $counter)
|
||||
uri=$(echo $status | jj uri)
|
||||
id_status=$(echo $status | jj id)
|
||||
dateutc=$(echo $status | jj created_at)
|
||||
reply_to_id=$(echo $status | jj in_reply_to_id)
|
||||
echo "$(date -d $dateutc "$format_time") <$id_status> $uri"
|
||||
if [ -n "$reply_to_id" ]; then
|
||||
echo "Reply to: $reply_to_id"
|
||||
fi
|
||||
echo "$status" | jj -r content | delqse | html_to_txt_render
|
||||
attachments=$(echo $status | jj -l media_attachments.#.remote_url | delq)
|
||||
if [ -n "$attachments" ]; then
|
||||
echo "#EXTINF:-1, $uri" >> attachments.m3u8
|
||||
echo "$attachments" >> attachments.m3u8
|
||||
fi
|
||||
counter=$(expr $counter + 1)
|
||||
echo '_____'
|
||||
done
|
||||
menuthread=$(echo 'Back' | fzy)
|
||||
case "$menuthread" in
|
||||
"Back") sub_menu_lvl=1 ;;
|
||||
"Back")
|
||||
sub_menu_lvl=1 ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
@ -371,12 +356,38 @@ timeline_api()
|
|||
timeline_menu()
|
||||
{
|
||||
json=$(timeline_api)
|
||||
indexator=$(expr $max_statuses - 1)
|
||||
sub_menu_lvl=1
|
||||
echo '#EXTM3U' > attachments.m3u8
|
||||
while [ $sub_menu_lvl -eq 1 ]; do
|
||||
ids_massive=$(echo $json | jj -l \#.id | delq)
|
||||
jsonmassive=$json
|
||||
statuses_render
|
||||
|
||||
while [ $indexator -gt 0 ]; do
|
||||
status=$(echo "$json" | jj $indexator)
|
||||
reblog=$(echo $status | jj reblog)
|
||||
uri=$(echo $status | jj uri)
|
||||
id_status=$(echo $status | jj id)
|
||||
dateutc=$(echo $status | jj created_at)
|
||||
reply_to_id=$(echo $status | jj in_reply_to_id)
|
||||
echo "$(date -d $dateutc "$format_time") <$id_status> $uri"
|
||||
if [ -n "$reply_to_id" ]; then
|
||||
echo "Reply to: $reply_to_id"
|
||||
fi
|
||||
if [ -n "$reblog" ]; then
|
||||
echo "$boost_symbol"
|
||||
fi
|
||||
spoiler_text=$(echo "$status" | jj spoiler_text)
|
||||
if [ -n "$spoiler_text" ]; then
|
||||
echo "#[$spoiler_text]"
|
||||
fi
|
||||
echo "$status" | jj -r content | delqse | html_to_txt_render
|
||||
attachments=$(echo $status | jj -l media_attachments.#.remote_url | sed 's/"//g')
|
||||
if [ -n "$attachments" ]; then
|
||||
echo "#EXTINF:-1, $uri" >> attachments.m3u8
|
||||
echo "$attachments" >> attachments.m3u8
|
||||
fi
|
||||
indexator=$(expr $indexator - 1)
|
||||
echo '_____'
|
||||
done
|
||||
menu=$(echo 'Prev\nNext\nReply\nShare\nFavorite\nThread\nMain menu' | fzy)
|
||||
case $menu in
|
||||
"Prev")
|
||||
|
@ -387,6 +398,7 @@ timeline_menu()
|
|||
json=$(timeline_api $offset)
|
||||
;;
|
||||
"Next")
|
||||
indexator=$(expr $max_statuses - 1)
|
||||
echo '#EXTM3U' > attachments.m3u8
|
||||
clear
|
||||
offset=$(jj -i preload 0.id)
|
||||
|
@ -433,7 +445,8 @@ timeline_menu()
|
|||
"Main menu")
|
||||
sub_menu_lvl=0 ;;
|
||||
esac
|
||||
done
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
share_api_status()
|
||||
|
|
Loading…
Reference in a new issue