]> git.cameronkatri.com Git - cgit.git/blobdiff - filters/email-gravatar.py
config: record repo.snapshot-prefix in the per-repo config
[cgit.git] / filters / email-gravatar.py
index 44456155fedd7801d5ae85bb1ae282350fcd4e31..d70440ea543cc30fd6de6512d03431a6f2dc97e3 100755 (executable)
@@ -20,6 +20,7 @@
 
 import sys
 import hashlib
+import codecs
 
 email = sys.argv[1].lower().strip()
 if email[0] == '<':
@@ -27,7 +28,12 @@ if email[0] == '<':
 if email[-1] == '>':
         email = email[0:-1]
 
+page = sys.argv[2]
+
+sys.stdin = codecs.getreader("utf-8")(sys.stdin.detach())
+sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
+
 md5 = hashlib.md5(email.encode()).hexdigest()
 text = sys.stdin.read().strip()
 
-print("<img src='//www.gravatar.com/avatar/" + md5 + "?s=13&d=retro' style='height:10pt;width:10pt'> " + text)
+print("<img src='//www.gravatar.com/avatar/" + md5 + "?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> " + text)