1 -- This script may be used with the email-filter or repo.email-filter settings in cgitrc.
2 -- It adds gravatar icons to author names. It is designed to be used with the lua:
3 -- prefix in filters. It is much faster than the corresponding python script.
7 -- <http://mkottman.github.io/luacrypto/>
10 local crypto = require("crypto")
12 function filter_open(email, page)
14 md5 = crypto.digest("md5", email:sub(2, -2):lower())
17 function filter_close()
18 html("<img src='//www.gravatar.com/avatar/" .. md5 .. "?s=13&d=retro' width='13' height='13' alt='Gravatar' /> " .. buffer)
22 function filter_write(str)
23 buffer = buffer .. str