mirror of
http://gitea.phreedom.club/localhost_frssoft/pleroma-cli
synced 2025-01-12 08:39:30 +00:00
Statuses separated by instance; some fixes
This commit is contained in:
parent
f66721780c
commit
39e7196839
|
@ -439,8 +439,8 @@ statuses_render()
|
|||
if [ "$reversed_statuses" = 'true' ]; then
|
||||
ids_massive=$(echo "$ids_massive" | tr ' ' '\n' | tac | tr '\n' ' ')
|
||||
fi
|
||||
export instance
|
||||
echo "$jsonmassive" | ./utils/statuses2files.sh
|
||||
./utils/extract_text_content.sh
|
||||
for i in $ids_massive; do
|
||||
status=$(echo "$jsonmassive" | jj "#[id=$i]")
|
||||
reblog=$(echo "$status" | jj reblog.id)
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Extract some content from statuses
|
||||
|
||||
for i in "$main_basedir"/statuses/*/*.json; do
|
||||
content=$(jj -i $i content | "$main_basedir"/utils/html_to_txt_render)
|
||||
status_id=$(jj -i $i 'id')
|
||||
status_date=$(jj -i $i 'created_at')
|
||||
touch -d "$status_date" "$main_basedir"/statuses/$status_id
|
||||
jj -i $i content | "$main_basedir"/utils/html_to_txt_render > "$main_basedir"/statuses/$status_id/content
|
||||
chmod 600 "$main_basedir"/statuses/$status_id/content
|
||||
done
|
|
@ -3,12 +3,17 @@
|
|||
# convert statuses as files and dirs
|
||||
json="$(cat)"
|
||||
ids=$(echo "$json" | jj -l '#.id' | sed 's/"//g')
|
||||
|
||||
if [ ! -d "$main_basedir/statuses/$instance" ]; then
|
||||
mkdir -p "$main_basedir/statuses/$instance"
|
||||
fi
|
||||
|
||||
for i in $ids; do
|
||||
if [ -f "$main_basedir"/statuses/$i.json ]; then
|
||||
if [ -f "$main_basedir"/statuses/$instance/$i.json ]; then
|
||||
continue
|
||||
fi
|
||||
mkdir -m 711 -p "$main_basedir"/statuses/$i
|
||||
echo "$json" | jj -p "#[id=$i]" > "$main_basedir"/statuses/$i/$i.json
|
||||
chmod 600 "$main_basedir"/statuses/$i/$i.json
|
||||
mkdir -m 711 -p "$main_basedir"/statuses/$instance/$i
|
||||
echo "$json" | jj -p "#[id=$i]" > "$main_basedir"/statuses/$instance/$i/$i.json
|
||||
chmod 600 "$main_basedir"/statuses/$instance/$i/$i.json
|
||||
done
|
||||
"$main_basedir"/utils/extract_text_content.sh
|
||||
"$main_basedir"/utils/extract_fields_statuses.sh
|
||||
|
|
Loading…
Reference in a new issue