From d33647fa0a034c5eddd3115789e0e17f0b6c0d93 Mon Sep 17 00:00:00 2001 From: foxt Date: Sat, 1 Apr 2023 12:11:38 +0100 Subject: [PATCH 1/2] Update algorithm.ts --- lib/algorithm.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/algorithm.ts b/lib/algorithm.ts index 76bf93d..e3dce25 100644 --- a/lib/algorithm.ts +++ b/lib/algorithm.ts @@ -24,6 +24,7 @@ export function rank(tweet: string): RankResponse { sentiment: theSentimentResponse, } const rules = [ + ghislaine(tweetData), elon(tweetData), tesla(tweetData), emojis(tweetData), @@ -80,6 +81,22 @@ export function rank(tweet: string): RankResponse { // Returning 0 has no impact on score // --------------------------- +/** + * The Ghislaine Maxwell picture didn't happen. + */ +function elon({ tweet }: TweetData): Rank { + if (tweet.indexOf("ghislaine") >= 0) { + return { + score: -100, + message: "Fake news.", + } + } + return { + score: 0, + } +} + + /** * Always talk about Elon in a positive light. */ From 6f430e8ccb1e24d10d8811a4409a15bc084bb433 Mon Sep 17 00:00:00 2001 From: foxt Date: Sun, 2 Apr 2023 13:53:16 +0100 Subject: [PATCH 2/2] fix `ghislaine` function name Co-authored-by: Raxit Majithiya <767683+raxityo@users.noreply.github.com> --- lib/algorithm.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/algorithm.ts b/lib/algorithm.ts index e3dce25..57d593d 100644 --- a/lib/algorithm.ts +++ b/lib/algorithm.ts @@ -84,7 +84,7 @@ export function rank(tweet: string): RankResponse { /** * The Ghislaine Maxwell picture didn't happen. */ -function elon({ tweet }: TweetData): Rank { +function ghislaine({ tweet }: TweetData): Rank { if (tweet.indexOf("ghislaine") >= 0) { return { score: -100,