From af1429d6d81a0bc708f7db7dd32a55f0d1f81561 Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Mon, 29 Nov 2021 13:30:53 -0700 Subject: [PATCH] list meta as txt --- posts.sh | 25 +++++++++++++++++++------ rclone.conf | 2 +- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/posts.sh b/posts.sh index 5931f61..dd4bb74 100644 --- a/posts.sh +++ b/posts.sh @@ -23,7 +23,7 @@ flags() { posts() { local want=() - for b64_json in $(list); do + for b64_json in $(list_posts); do local json="$(echo "$b64_json" | base64 --decode)" local filename="$(echo "$json" | jq -r .Name)" want+=("$(imported "$json")") @@ -50,6 +50,9 @@ posts() { } meta() { + for b64_json in $(list_meta); do + echo "$b64_json" | base64 --decode | jq . + done false } @@ -62,8 +65,12 @@ log() { echo "$(date +%H:%M:%S) > $*" >&2 } -list() { - gd list_posts +list_posts() { + RCLONE_OPTS="$RCLONE_OPTS --drive-export-formats zip" gd list_posts +} + +list_meta() { + RCLONE_OPTS="$RCLONE_OPTS --drive-export-formats txt" gd list_meta } up_to_date() { @@ -163,14 +170,20 @@ metadata() { } gd() ( - list_posts() { - rc lsjson "$RCLONE_ALIAS:$RCLONE_FOLDER/$RCLONE_FOLDER_POSTS" \ + list() { + rc lsjson "$RCLONE_ALIAS:$RCLONE_FOLDER/$1" \ | jq -c .[] \ - | grep zip\" \ + | grep -E '(zip|txt)"' \ | while read -r line; do echo "$line" | base64 done } + list_posts() { + gd list "$RCLONE_FOLDER_POSTS" + } + list_meta() { + gd list "$RCLONE_FOLDER_META" + } pull_posts() { rc copy "$RCLONE_ALIAS:$RCLONE_FOLDER/$RCLONE_FOLDER_POSTS/$1" "$TMPDIR"/ } diff --git a/rclone.conf b/rclone.conf index 587b4ce..8373a0b 100644 --- a/rclone.conf +++ b/rclone.conf @@ -5,6 +5,6 @@ client_secret = zCqs6bTjTm6TivvdU4BxhR19 scope = drive #team_drive = 1-p043gwMk88rj4-Sm5otARi_AJZYskbj #root_folder_id = 1-p043gwMk88rj4-Sm5otARi_AJZYskbj -formats = zip,html,rtf,odt,docx,xlsx,pptx,svg +#formats = zip,html,rtf,odt,docx,xlsx,pptx,svg token = {"access_token":"ya29.a0ARrdaM-Ca19JFA2LNKls0IsuLLGEF2M2eytTRxRP-YoS73oJvhDOi_xdw48uu0c8q5wrLglRfPBVZM5h48Oe4fJBVTPMR96b1ySUXWCscuh-GtWHV0iF4JxlIqY3bgR6lg5odyiUvXRFauh0JcZ10ozJ7mUy4g","token_type":"Bearer","refresh_token":"1//04sQD4800FsqyCgYIARAAGAQSNwF-L9IrB1_7BV8ScFnqmIz8FNWgXfr80--6VG6KX1pTnneQKAz6Ss3YtxqmCdf2tRBy2ndkhek","expiry":"2021-11-29T13:47:23.55774-07:00"}