If you have an imessage chat where you post wordles, this will give you epic stats.
How cool would it be to have a message like this posted to your chat every day AUTOMATICALLY?
⏰ Today's Wordle (1408, WEEDY) was harder than 93% of all 138 chat Wordles
🎯 Chat averaged 4.86 (NYT average of 4.5)
🟩🟩🟩🟩⬜ 7/8 attempts
🔥 Most impressive guess was from Simba
Well, this explains how to do that. It would be good if you knew some ruby and basic mac terminal commands.
Note: This system now uses CSV-based storage for better performance and accessibility. All Wordle data is stored in data/wordle_results.csv. See CSV_MIGRATION.md for details on the data structure and migration process.
-
Clone this repository
-
Install dependencies:
bundle install
-
Make two scripts executable:
chmod +x scripts/pull_chat.sh
chmod +x scripts/send_message.sh
-
Make sure you have the necessary permissions enabled for your terminal app. On recent macOS versions, you may need to grant Terminal full disk access in System Preferences > Security & Privacy > Privacy > Full Disk Access.
-
Get your iMessage chat ID by running this applescript inside the Script Editor program. You may need to do some trial and error to determine if you have the correct chat ID, but it will be the one with the correct phone numbers. When you copy the chat id, make sure you remove the
*at the end.
tell application "Messages"
set allChats to chats
repeat with c in allChats
log "======================="
log "Chat ID: " & id of c
try
repeat with p in participants of c
log "Participant: " & handle of p
end repeat
on error errMsg
log "Error getting participants: " & errMsg
end try
end repeat
end tell
- Create a
.envfile in the root of this directory and add the following data:
CHAT_ID="paste iMessage chat id"
CHAT_NAME="Your iMessage chat name"
CONTACTS='{
"Me": "Your name",
"10000000" :"Your friend's name",
"otherfriend@test.com": "Your other friend's name"}'
}'
- To pull your chat data, run
scripts/pull_chat.sh
Here are the scripts you can run:
-
Run
ruby scripts/stats.rbThis will generate a table of wordle stats by player for the entire history of the chat.
-
Run
ruby scripts/today.rbPull Today's Wordle and display stats for it. -
Run
ruby scripts/yesterday.rbPull Yesterday's Wordle and display stats for it. -
Run
ruby scripts/word_difficulty.rbOutputs all the words in the chat and their difficulty. Also outputs the most impressive guessers. -
Run
scripts/send_message.shThis will send a message to your iMessage chat with the wordle stats for yesterday. You can even hook it up to a mac shortcut. Choose the "Run Shell Script" action and paste the following:
~/myuser/path/to/wordle_chat_stats/bin/send_message_shortcut_script.shNow add the file bin/send_message_shortcut_script.sh with the following contents:
#!/bin/zsh
source ~/.zshrc
export PATH="/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
cd ~/path/to/wordle_chat_stats || exit 1
./scripts/send_message.shYou will need to grant full disc access to the Shortcuts app.
Now you can post yesterday's stats to your chat with the click of a button!
Feel free to customize the script to your liking and add any stats.
Now, you can feel better about yourself when a word is really difficult.