Software /
code /
prosody-modules
Comparison
mod_pubsub_summary/mod_pubsub_summary.lua @ 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 |
parent | 5129:cde38b7de04a |
child | 5135:35085e0d52ad |
comparison
equal
deleted
inserted
replaced
5130:0772facc786f | 5131:82e7251d4f52 |
---|---|
41 if link and link.attr.href and link.attr.href ~= content then | 41 if link and link.attr.href and link.attr.href ~= content then |
42 summary = (summary and summary .. "\n" or "") .. link.attr.href; | 42 summary = (summary and summary .. "\n" or "") .. link.attr.href; |
43 if link.attr.rel and link.attr.rel ~= "alternate" then summary = summary .. " [" .. link.attr.rel .. "]" end | 43 if link.attr.rel and link.attr.rel ~= "alternate" then summary = summary .. " [" .. link.attr.rel .. "]" end |
44 end | 44 end |
45 end | 45 end |
46 for area in payload:childtags("area", "urn:oasis:names:tc:emergency:cap:1.2") do | |
47 local pos = area:get_child_text("circle"); | |
48 if pos then | |
49 summary = summary .. "\n" .. "geo:"..pos:match("[%d.,]+"); | |
50 end | |
51 end | |
46 return summary; | 52 return summary; |
47 end, 1); | 53 end, 1); |