aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/vendor/rss/xml.example.md
diff options
context:
space:
mode:
authorLibravatarLarge Libravatar memdmp <memdmpestrogenzone>2026-01-26 04:36:52 +0100
committerLibravatarLarge Libravatar memdmp <memdmpestrogenzone>2026-01-26 04:36:52 +0100
commit7a3a7eb9c8e1012a75e6956ba476f13beb414f4c (patch)
tree5b88332082e99c9a33b0735f33006dccbd6a067d /src/lib/vendor/rss/xml.example.md
parent24e0e8c29e6e63f2fa7b88cf9e29bbf4f8918f43 (diff)
downloadmem-estrogen-zone-7a3a7eb9c8e1012a75e6956ba476f13beb414f4c.tar.gz
mem-estrogen-zone-7a3a7eb9c8e1012a75e6956ba476f13beb414f4c.tar.bz2
mem-estrogen-zone-7a3a7eb9c8e1012a75e6956ba476f13beb414f4c.tar.lz
mem-estrogen-zone-7a3a7eb9c8e1012a75e6956ba476f13beb414f4c.zip

feat: a bit of XML as a treat

Diffstat (limited to 'src/lib/vendor/rss/xml.example.md')
-rw-r--r--src/lib/vendor/rss/xml.example.md242
1 files changed, 242 insertions, 0 deletions
diff --git a/src/lib/vendor/rss/xml.example.md b/src/lib/vendor/rss/xml.example.md
new file mode 100644
index 0000000..ba006e2
--- /dev/null
+++ b/src/lib/vendor/rss/xml.example.md
@@ -0,0 +1,242 @@
+# xml example
+
+If you like directly working with XML, here's an example of how to for this:
+
+```ts
+const posts = [
+ {
+ title: 'Launching SSH during early boot with mkinitfs',
+ url: 'https://estrogen.zone/~mem/blog/1768406136',
+ blurb: 'Replacing the early init with our own script to launch SSH, killing it in early userspace, and allowing remote disk decryption in the mean time',
+ author: '7222e800',
+ guid: '1768406136',
+ published: new Date('2026-01-14T15:53:57Z').toUTCString()
+ }
+];
+const doc = new XMLDocumentRoot().child(
+ new XMLDeclaration().version().encoding(),
+ new XMLRootElement("rss")
+ .attribute("version", "2.0")
+ .xmlns("content", "http://purl.org/rss/1.0/modules/content/")
+ .child(
+ new XMLElement('channel')
+ .child(
+ new XMLElement('title').child(new XMLText('Latest blog posts for 7222e800')),
+ new XMLElement('link').child(new XMLText('https://estrogen.zone/~mem/blog/')),
+ new XMLElement('description').child(new XMLText('Some Description')),
+ new XMLElement('pubDate').child(new XMLText(new Date().toUTCString())),
+ ...posts.map(post => new XMLElement('item').child(
+ new XMLElement('title').child(new XMLText(post.title)),
+ new XMLElement('link').child(new XMLText(post.url)),
+ new XMLElement('description').child(new XMLText(post.blurb)),
+ new XMLElement('author').child(new XMLText(post.author)),
+ new XMLElement('guid').child(new XMLText(post.guid)),
+ new XMLElement('published').child(new XMLText(post.published)),
+ ))
+ )
+ )
+);
+console.log(
+ util.inspect(
+ doc,
+ { compact: false, colors: true, breakLength: 80, depth: 90 }, true
+ )
+);
+console.log(doc.toString());
+```
+
+as of writing, will output this internal state:
+
+```log
+XMLDocumentRoot {
+ attributes: Map(0) {},
+ children: [
+ XMLDeclaration {
+ attributes: Map(2) {
+ 'version' => '1.0',
+ 'encoding' => 'UTF-8'
+ },
+ children: [],
+ tagType: '#declaration'
+ },
+ XMLRootElement {
+ attributes: Map(2) {
+ 'version' => '2.0',
+ 'xmlns:content' => 'http://purl.org/rss/1.0/modules/content/'
+ },
+ children: [
+ XMLElement {
+ attributes: Map(0) {},
+ children: [
+ XMLElement {
+ attributes: Map(0) {},
+ children: [
+ XMLText {
+ tagType: '#text',
+ text: 'Latest blog posts for 7222e800'
+ }
+ ],
+ tagType: '#element',
+ tagName: 'title'
+ },
+ XMLElement {
+ attributes: Map(0) {},
+ children: [
+ XMLText {
+ tagType: '#text',
+ text: 'https://estrogen.zone/~mem/blog/'
+ }
+ ],
+ tagType: '#element',
+ tagName: 'link'
+ },
+ XMLElement {
+ attributes: Map(0) {},
+ children: [
+ XMLText {
+ tagType: '#text',
+ text: 'Some Description'
+ }
+ ],
+ tagType: '#element',
+ tagName: 'description'
+ },
+ XMLElement {
+ attributes: Map(0) {},
+ children: [
+ XMLText {
+ tagType: '#text',
+ text: 'Mon, 26 Jan 2026 03:34:31 GMT'
+ }
+ ],
+ tagType: '#element',
+ tagName: 'pubDate'
+ },
+ XMLElement {
+ attributes: Map(0) {},
+ children: [
+ XMLElement {
+ attributes: Map(0) {},
+ children: [
+ XMLText {
+ tagType: '#text',
+ text: 'Launching SSH during early boot with mkinitfs'
+ }
+ ],
+ tagType: '#element',
+ tagName: 'title'
+ },
+ XMLElement {
+ attributes: Map(0) {},
+ children: [
+ XMLText {
+ tagType: '#text',
+ text: 'https://estrogen.zone/~mem/blog/1768406136'
+ }
+ ],
+ tagType: '#element',
+ tagName: 'link'
+ },
+ XMLElement {
+ attributes: Map(0) {},
+ children: [
+ XMLText {
+ tagType: '#text',
+ text: 'Replacing the early init with our own script to launch SSH, killing it in early userspace, and allowing remote disk decryption in the mean time'
+ }
+ ],
+ tagType: '#element',
+ tagName: 'description'
+ },
+ XMLElement {
+ attributes: Map(0) {},
+ children: [
+ XMLText {
+ tagType: '#text',
+ text: '7222e800'
+ }
+ ],
+ tagType: '#element',
+ tagName: 'author'
+ },
+ XMLElement {
+ attributes: Map(0) {},
+ children: [
+ XMLText {
+ tagType: '#text',
+ text: '1768406136'
+ }
+ ],
+ tagType: '#element',
+ tagName: 'guid'
+ },
+ XMLElement {
+ attributes: Map(0) {},
+ children: [
+ XMLText {
+ tagType: '#text',
+ text: 'Wed, 14 Jan 2026 15:53:57 GMT'
+ }
+ ],
+ tagType: '#element',
+ tagName: 'published'
+ }
+ ],
+ tagType: '#element',
+ tagName: 'item'
+ }
+ ],
+ tagType: '#element',
+ tagName: 'channel'
+ }
+ ],
+ tagType: '#element',
+ tagName: 'rss'
+ }
+ ],
+ tagType: '#document'
+}
+```
+
+and this RSS:
+
+```xml
+<?xml version="1.0" encoding="UTF-8" ?>
+<rss version="2.0"
+ xmlns:content="http://purl.org/rss/1.0/modules/content/">
+ <channel>
+ <title>
+ Latest blog posts for 7222e800
+ </title>
+ <link>
+ https://estrogen.zone/~mem/blog/
+ </link>
+ <description>
+ Some Description
+ </description>
+ <pubDate>
+ Mon, 26 Jan 2026 03:34:31 GMT
+ </pubDate>
+ <item>
+ <title>
+ Launching SSH during early boot with mkinitfs
+ </title>
+ <link>
+ https://estrogen.zone/~mem/blog/1768406136
+ </link>
+ <description>
+ Replacing the early init with our own script to launch SSH, killing it in early userspace, and allowing remote disk decryption in the mean time
+ </description>
+ <author>
+ 7222e800
+ </author>
+ <guid>
+ 1768406136
+ </guid>
+ <published>
+ Wed, 14 Jan 2026 15:53:57 GMT
+ </published>
+ </item>
+ </channel>
+</rss>
+```