Created
October 24, 2018 23:13
-
-
Save richo/fcbd5f57c8c1c9123e005b3697a94885 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
import string | |
replacements = { | |
'!': ':exclamation:', | |
'?': ':question:', | |
'0': ':zero:', | |
'1': ':one:', | |
'2': ':two:', | |
'3': ':three:', | |
'4': ':four:', | |
'5': ':five:', | |
'6': ':six:', | |
'7': ':seven:', | |
'8': ':eight:', | |
'9': ':nine:', | |
'™': ':tm:', | |
} | |
def embiggen_word(word): | |
def inner(_word): | |
for i in word.lower(): | |
if i in string.ascii_lowercase: | |
yield ":big-%s:" % i | |
else: | |
yield replacements.get(i, i) | |
return ''.join(inner(word)) | |
sys.stdout.write(":sparkles:%s:end_sparkles:" % (' '.join(map(embiggen_word, sys.argv[1:])))) | |
sys.stdout.flush() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment