changeset 5131:82e7251d4f52

mod_pubsub_summary: Render geo:-URI from OASIS emergency broadcasts Used in Swedish Emergency information feed
author Kim Alvefur <zash@zash.se>
date Sun, 08 Jan 2023 13:45:30 +0100
parents 0772facc786f
children 36b5677b9648
files mod_pubsub_summary/mod_pubsub_summary.lua
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_pubsub_summary/mod_pubsub_summary.lua	Sat Jan 07 17:36:16 2023 +0100
+++ b/mod_pubsub_summary/mod_pubsub_summary.lua	Sun Jan 08 13:45:30 2023 +0100
@@ -43,5 +43,11 @@
 			if link.attr.rel and link.attr.rel ~= "alternate" then summary = summary .. " [" .. link.attr.rel .. "]" end
 		end
 	end
+	for area in payload:childtags("area", "urn:oasis:names:tc:emergency:cap:1.2") do
+		local pos = area:get_child_text("circle");
+		if pos then
+			summary = summary .. "\n" .. "geo:"..pos:match("[%d.,]+");
+		end
+	end
 	return summary;
 end, 1);