about summary refs log tree commit diff
path: root/filters/email-gravatar.lua
blob: 52cf4268a4963188e577aa0de8b06ad5dfc447c3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
-- This script may be used with the email-filter or repo.email-filter settings in cgitrc.
-- It adds gravatar icons to author names. It is designed to be used with the lua:
-- prefix in filters. It is much faster than the corresponding python script.
--
-- Requirements:
-- 	luacrypto >= 0.3
-- 	<http://mkottman.github.io/luacrypto/>
--

local crypto = require("crypto")

function filter_open(email, page)
	buffer = ""
	md5 = crypto.digest("md5", email:sub(2, -2):lower())
end

function filter_close()
	html("<img src='//www.gravatar.com/avatar/" .. md5 .. "?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> " .. buffer)
	return 0
end

function filter_write(str)
	buffer = buffer .. str
end


amp;id=334ef59c6239caee2505b7e36596942ad636e63f&follow=1'>tls_signer: Replace ECDSA_METHOD with EC_KEY_METHODJune McEnroe 2022-02-27tls: Replace ECDSA_METHOD with EC_KEY_METHODJune McEnroe 2022-02-27Import LibreSSL 3.5.0June McEnroe 2021-11-29tls: Revert accidentally(?) reverted upstream 3.4.2June McEnroe 2021-11-29Import LibreSSL 3.4.2June McEnroe 2021-10-14Import LibreSSL 3.4.1June McEnroe 2021-09-17Import LibreSSL 3.4.0June McEnroe 2021-08-24Import LibreSSL 3.3.4June McEnroe 2021-05-25Bump version to 3.3.3p1 3.3.3p1June McEnroe 2021-05-25build: Add scripts to EXTRA_DISTJune McEnroe 2021-05-25import: Add missing scripts/wrap-compiler-for-flag-checkJune McEnroe 2021-05-08Import LibreSSL 3.3.3June McEnroe 2021-04-18build: Remove added x509_verify.3 links 3.3.2June McEnroe 2021-04-18tls: Use EC_KEY_set_ex_dataJune McEnroe 2021-04-18Import LibreSSL 3.3.2June McEnroe 2021-03-05Bump version to 3.3.1p1 3.3.1p1June McEnroe 2021-03-05build: Add OpenSSL includes to libcompatJune McEnroe 2020-12-15Import LibreSSL 3.3.1June McEnroe 2020-11-24Import LibreSSL 3.3.0June McEnroe 2020-10-22Import LibreSSL 3.2.2June McEnroe 2020-09-29Import LibreSSL 3.2.1June McEnroe 2020-09-29import: Add m4/ax_add_fortify_source.m4June McEnroe 2020-08-05build: Add README.7 to EXTRA_DIST 3.2.0June McEnroe 2020-08-03doc: Indicate that only OpenSSL 1.1.1b and newer workJune McEnroe