module PostAudit
Overview
Checks for a batch of LinkedIn posts, following the steps of the LinkedIn Content Strategy playbook: count every post against the length band, keep numbered lists to 40% of a batch, gate every topic on active discussion in the last 30 days with a source noted, keep comments to one to three sentences ending in a real question, and rank commenters above likers.
Defined in:
audit.crConstant Summary
-
MAX_NUMBERED_SHARE =
0.40 -
NUMBERED =
"numbered_list" -
TOPIC_WINDOW_DAYS =
30
Class Method Summary
- .band(chars : Int32, min : Int32, max : Int32) : Band
-
.comment_problems(text : String) : Array(String)
A comment fits when it is one to three sentences and ends with a question.
-
.numbered_ok?(posts : Array(Post)) : Bool
A batch passes when numbered lists are no more than 40% of it.
-
.numbered_share(posts : Array(Post)) : Float64
Share of the batch that is a numbered list, as a fraction.
-
.parse_posts(text : String) : Array(Post)
Parse "id,chars,structure,angle,visual,topic_source,topic_days".
-
.parse_responders(text : String) : Array(Responder)
Parse "name,type" with type commenter or liker.
-
.rank_responders(list : Array(Responder)) : Array(Responder)
Commenters rank above likers; each group keeps its input order.
-
.sentence_count(text : String) : Int32
Number of sentences: runs of text ending in .
-
.topic_gate(p : Post) : String | Nil
A topic passes the gate when it has a source noted and was in active discussion within the last 30 days.
-
.variety(posts : Array(Post), dim : Symbol) : Array(Tuple(String, Int32))
Counts per value for one dimension (structure, angle or visual), most frequent first.
Class Method Detail
A comment fits when it is one to three sentences and ends with a question.
A batch passes when numbered lists are no more than 40% of it.
Parse "id,chars,structure,angle,visual,topic_source,topic_days". A blank topic_days means unknown.
Parse "name,type" with type commenter or liker.
Commenters rank above likers; each group keeps its input order.
Number of sentences: runs of text ending in . ! or ? (a trailing fragment counts as one).
A topic passes the gate when it has a source noted and was in active discussion within the last 30 days.
Counts per value for one dimension (structure, angle or visual), most frequent first.