Last active
May 22, 2019 08:12
-
-
Save decrn/8f6454f514f481b5f5bd9df33e4e221e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# !bin/sh | |
# groups words by most common occurence and highlights colon emojis e.g. :slighty_smiling_face: | |
# useful in combination with e.g. a message scraper for Slack | |
# macOS? brew install gnu-sed to swap casing | |
# change all seds to gsed or add it to your PATH | |
# ps coreutils is bloatware | |
echo 'some random random text :stuckouttongue:' \ | |
| tr '[:upper:]' '[:lower:]' \ | |
| sed 's/[\w \W \s]*http[s]*[a-z0-9 : \. \/ ; % " \W]*/ /g' \ | |
| tr '[:space:]' '[\n*]' \ | |
| sed 's/:\S*:/\U&/g' \ | |
| sed 's/[[:punct:]]//g; s/[[:space:]]/\n/g' \ | |
| grep -v "^\s*$" \ | |
| sort \ | |
| uniq -c | sort -bn | |
| sed 51q |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment