clemmy/commands/posts.sh

7 lines
498 B
Bash
Raw Normal View History

2023-01-17 01:46:39 +11:00
#Post hoardan
2023-07-02 19:28:33 +10:00
save(){ put "post/save" '{"post_id":'$1',"save":true}'; }
unsave(){ put "post/save" '{"post_id":'$1',"save":false}'; }
load(){ get "post/list" ".posts | .[] | $short_post_jq" "type_=All&saved_only=true"; }
2023-01-17 01:46:39 +11:00
#Postan
2023-07-02 19:28:33 +10:00
freepost(){ getbody; post "post" '{"community_id":'$1',"name":"'${*:2}'","body":"'$body'"}'; }
shitpost(){ getbody; postid=$1; parentid=$2; if [ -z $parentid ]; then parentid=null; fi; post "comment" '{"post_id":'$postid',"parent_id":'$parentid',"content":"'$body'"}'; }