From 55de905236a071af0921d1f51da9a47099a5f7a7 Mon Sep 17 00:00:00 2001 From: Andy Lulham Date: Tue, 21 May 2024 07:33:09 +0100 Subject: [PATCH] feat: show total ratings --- output/index.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/output/index.md b/output/index.md index 44c58ede..dbd8d450 100644 --- a/output/index.md +++ b/output/index.md @@ -17,6 +17,7 @@ Proposed [Twitter community notes](https://twitter.com/i/communitynotes/download Tweet status Username Tweet content + Total ratings @@ -200,6 +201,20 @@ Proposed [Twitter community notes](https://twitter.com/i/communitynotes/download visible: false, defaultContent: '' }, + { + data: 'rating', + searchable: true, + visible: true, + render: function (data, type, row, meta) { + if (!data) { + return 0; + } + if (type === 'display') { + return data.reduce((x, y) => x + y, 0); + } + return data; + } + }, ], drawCallback: function (settings) { twttr.widgets.load();