Comments no longer show post's link instead of id->replyid.
This commit is contained in:
parent
7fe2645f58
commit
83ce8024a3
|
@ -11,13 +11,19 @@ TOKE=${tokes[0]}
|
||||||
|
|
||||||
baseurl="https://$INSTANCE/api/v3/"
|
baseurl="https://$INSTANCE/api/v3/"
|
||||||
# Please don't abuse jq like this
|
# Please don't abuse jq like this
|
||||||
|
showpost='(.post | (.id | tostring)+" "+(.name | tostring)),
|
||||||
|
(.post.url)+", "+(.creator.display_name // .creator.name)+":",
|
||||||
|
((.comment // .post) | .published,
|
||||||
|
(.body // .content)),
|
||||||
|
""'
|
||||||
showcomment='(.post | (.id | tostring)+" "+(.name | tostring)),
|
showcomment='(.post | (.id | tostring)+" "+(.name | tostring)),
|
||||||
(.post.url // (.comment | (.parent_id | tostring)+"->"+(.id | tostring)))+", "+(.creator.display_name // .creator.name)+":",
|
(.comment | (.parent_id | tostring)+"->"+(.id | tostring))+", "+(.creator.display_name // .creator.name)+":",
|
||||||
((.comment // .post) | .published,
|
((.comment // .post) | .published,
|
||||||
(.body // .content)),
|
(.body // .content)),
|
||||||
""'
|
""'
|
||||||
|
|
||||||
comments=".[] | $showcomment"
|
comments=".[] | $showcomment"
|
||||||
|
posts=".[] | $showpost"
|
||||||
|
|
||||||
#Generics
|
#Generics
|
||||||
get(){ curl -s "$baseurl$1?${*:3}" | jq "$2"; }
|
get(){ curl -s "$baseurl$1?${*:3}" | jq "$2"; }
|
||||||
|
@ -34,15 +40,15 @@ actions="notifs notifs2 comments freepost shitpost follow unfollow following der
|
||||||
#Lurkan
|
#Lurkan
|
||||||
notifs(){ getauth "user/replies" ".replies | $comments"; }
|
notifs(){ getauth "user/replies" ".replies | $comments"; }
|
||||||
notifs2(){ getauth "user/mention"; }
|
notifs2(){ getauth "user/mention"; }
|
||||||
following(){ getauth "post/list" ".posts | $comments" "type_=Subscribed"; }
|
following(){ getauth "post/list" ".posts | $posts" "type_=Subscribed"; }
|
||||||
comments(){ getauth "post" "(.post_view | $showcomment), (.comments | reverse | $comments)" "id=$1"; }
|
comments(){ getauth "post" "(.post_view | $showpost), (.comments | reverse | $comments)" "id=$1"; }
|
||||||
#Postan
|
#Postan
|
||||||
freepost(){ getbody; post "post" "{\"community_id\":$1,\"name\":\"$2\",\"body\":\"$body\"}"; }
|
freepost(){ getbody; post "post" "{\"community_id\":$1,\"name\":\"$2\",\"body\":\"$body\"}"; }
|
||||||
shitpost(){ getbody; postid=$1; parentid=$2; post "comment" "{\"post_id\":$postid,\"parent_id\":$parentid,\"content\":\"$body\"}"; }
|
shitpost(){ getbody; postid=$1; parentid=$2; post "comment" "{\"post_id\":$postid,\"parent_id\":$parentid,\"content\":\"$body\"}"; }
|
||||||
#Post hoardan
|
#Post hoardan
|
||||||
save(){ put "post/save" "{\"post_id\":$1,\"save\":true}"; }
|
save(){ put "post/save" "{\"post_id\":$1,\"save\":true}"; }
|
||||||
unsave(){ put "post/save" "{\"post_id\":$1,\"save\":false}"; }
|
unsave(){ put "post/save" "{\"post_id\":$1,\"save\":false}"; }
|
||||||
load(){ getauth "post/list" ".posts | $comments" "type_=All&saved_only=true"; }
|
load(){ getauth "post/list" ".posts | $posts" "type_=All&saved_only=true"; }
|
||||||
#Community hoardan
|
#Community hoardan
|
||||||
follow(){ post "community/follow" "{\"community_id\":$1,\"follow\":true}"; }
|
follow(){ post "community/follow" "{\"community_id\":$1,\"follow\":true}"; }
|
||||||
unfollow(){ post "community/follow" "{\"community_id\":$1,\"follow\":false}"; }
|
unfollow(){ post "community/follow" "{\"community_id\":$1,\"follow\":false}"; }
|
||||||
|
|
Loading…
Reference in New Issue
Block a user