Skip to content

Commit

Permalink
feat: show total ratings
Browse files Browse the repository at this point in the history
  • Loading branch information
andylolz committed May 21, 2024
1 parent 22204fe commit 55de905
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions output/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Proposed [Twitter community notes](https://twitter.com/i/communitynotes/download
<th>Tweet status</th>
<th>Username</th>
<th>Tweet content</th>
<th>Total ratings</th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 55de905

Please sign in to comment.