relay and archive sitemaps xml (with a nice hack because htmlgo is not xml-friendly.)

This commit is contained in:
fiatjaf
2023-10-21 13:34:32 -03:00
parent 65025d4967
commit f70b13afe7
6 changed files with 62 additions and 27 deletions

View File

@@ -22,6 +22,8 @@ import (
"github.com/nbd-wtf/go-nostr/nip19"
)
const XML_HEADER = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
var (
urlSuffixMatcher = regexp.MustCompile(`[\w-_.]+\.[\w-_.]+(\/[\/\w]*)?$`)
nostrEveryMatcher = regexp.MustCompile(`nostr:((npub|note|nevent|nprofile|naddr)1[a-z0-9]+)\b`)