remove messages like missed your call, called you., Reacted ð to your message, You set the quick reaction to ð¤£, remove any blank messages, the apostrophes are messed up so fix those, add an inforrgraph about the conversation like total messages per person emojis sent, if multiple json are uploaded merge them
d295941 verified Download script.js from ToonTownTommy/chatscrub-deluxe-pro: direct link, hf CLI and curl.
- Browser
- Download file 967 Bytes
-
https://huggingface.co/spaces/ToonTownTommy/chatscrub-deluxe-pro/resolve/main/script.js
- Command line
-
hf download hf://spaces/ToonTownTommy/chatscrub-deluxe-pro/script.js
-
curl -L -o script.js https://huggingface.co/spaces/ToonTownTommy/chatscrub-deluxe-pro/resolve/main/script.js
967 Bytes
| function generateConversationStats(data) { | |
| const stats = { | |
| totalMessages: data.messages.length, | |
| messagesBySender: {}, | |
| emojiUsage: {}, | |
| topEmojis: {} | |
| }; | |
| // Count messages by sender | |
| data.messages.forEach(msg => { | |
| if (msg.sender_name) { | |
| stats.messagesBySender[msg.sender_name] = | |
| (stats.messagesBySender[msg.sender_name] || 0) + 1; | |
| } | |
| // Count emoji usage | |
| if (msg.content) { | |
| const emojiRegex = /[\p{Emoji}]/gu; | |
| const emojis = msg.content.match(emojiRegex) || []; | |
| emojis.forEach(emoji => { | |
| stats.emojiUsage[emoji] = (stats.emojiUsage[emoji] || 0) + 1; | |
| }); | |
| } | |
| }); | |
| // Sort and get top 10 emojis | |
| stats.topEmojis = Object.fromEntries( | |
| Object.entries(stats.emojiUsage) | |
| .sort((a, b) => b[1] - a[1]) | |
| .slice(0, 10) | |
| ); | |
| return stats; | |
| } |