Created
October 7, 2015 20:56
-
-
Save jferris/f15fca383b178deb0e18 to your computer and use it in GitHub Desktop.
"Programming"
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/zsh | |
original=$(cat) | |
print "$original" > /tmp/mutt_message | |
ascii=$(print "$original" | recode utf-8..iso-8859-1 2>&1) | |
if echo "${ascii}" | egrep --silent "recode: Invalid input"; then | |
message=$(cat /tmp/mutt_message) | |
else | |
message=$(print "$ascii" | recode HTML_4.0) | |
fi | |
if echo "${message}" | egrep --silent "^From: Trello"; then | |
echo "${message}" | trelloparse | |
else | |
echo "${message}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment