Compare commits

...

2 Commits

Author SHA1 Message Date
69310e8229 fix rss
Some checks failed
ci / test (push) Failing after 12m59s
fp/our CI/CD / build (push) Successful in 1m18s
2025-11-14 18:18:07 -08:00
17ea5c3336 add anchors to detail headings 2025-11-14 17:25:26 -08:00
11 changed files with 48 additions and 207 deletions

View File

@ -1,6 +1,6 @@
{
"name": "futureporn",
"version": "3.3.0",
"version": "3.4.0",
"private": true,
"description": "Dedication to the preservation of lewdtuber history",
"license": "Unlicense",

View File

@ -75,7 +75,9 @@
</p>
<div class="notification is-warning">A lot of things are broken right now and may not work. Please check back again soon.</div>
<div class="container">
<div class="notification is-info">Hello World</div>
</div>
</div>
</footer>

View File

@ -50,30 +50,30 @@
<% if (vtubers.length === 0) { %>None<% } %>
</p>
<p><b>Stream Date:</b> <%= data.vod?.get('streamDate') ?? 'Unknown date' %></p>
<p><b id="stream-date">Stream Date:</b> <%= data.vod?.get('streamDate') ?? 'Unknown date' %></p>
<% if (data.vod?.get('announceUrl')) { %>
<p>
<b>Announce URL:</b>
<b id="announce-url">Announce URL:</b>
<a href="<%= data.vod?.get('announceUrl') %>"><%= data.vod?.get('announceUrl') %></a>
</p>
<% } %>
<% if (data.vod?.get('ipfsCid')) { %>
<p><b>IPFS CID:</b> <%= data.vod?.get('ipfsCid') %></p>
<p><b id="ipfs-cid">IPFS CID:</b> <%= data.vod?.get('ipfsCid') %></p>
<% } %>
<% if (data.vod?.get('magnetLink')) { %>
<p><b>Magnet Link:</b> <%= data.vod?.get('magnetLink') %></p>
<p><b id="magnet-link">Magnet Link:</b> <%= data.vod?.get('magnetLink') %></p>
<% } %>
<% if (data.vod?.get('notes')) { %>
<p><b>Notes:</b></p>
<p><b id="notes">Notes:</b></p>
<div class="p-2 level"><%- data.vod?.get('notes') %></div>
<% } %>
<% if (data.vod?.get('thumbnail')) { %>
<p><b>Thumbnail:</b></p>
<p><b id="thumbnail">Thumbnail:</b></p>
<figure class="image">
<img src="/api/files/vods/<%= data.vod?.get('id') %>/<%= data.vod?.get('thumbnail') %>" />
</figure>

View File

@ -1,26 +0,0 @@
// +load.js
/** @type {import('pocketpages').PageDataLoaderFunc} */
module.exports = function (api) {
const { params, response } = api;
try {
const vods = $app.findRecordsByFilter('vods', null, '-streamDate');
$app.expandRecords(vods, ["vtubers"], null);
// vods.expandedAll("vtubers");
return { vods };
} catch (e) {
console.error('error!', e.message);
if (e.message.match(/no rows/)) {
console.log('we are sending 404')
return response.html(404, 'VODs not found')
} else {
console.log('we are sending error 500')
return response.html(500, 'Unknown internal error while fetching vods')
}
}
};

View File

@ -1,50 +0,0 @@
<%#
index.ejs — Atom Feed Generator (Atom 1.0)
Expects: data.vods = [{ id, title, summary, streamDate }]
%>
<%
const siteBase = "https://futureporn.net";
const feedSelf = `${siteBase}/vods/feed.xml`;
const updated = new Date().toISOString();
response.header('Content-Type', 'application/atom+xml')
%>
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<id><%= siteBase %></id>
<title>Futureporn.net</title>
<updated><%= updated %></updated>
<generator> </generator>
<author>
<name>CJ_Clippy</name>
<email>cj@futureporn.net</email>
<uri><%= siteBase %></uri>
</author>
<link rel="alternate" href="<%= siteBase %>" />
<link rel="self" href="<%= feedSelf %>" />
<subtitle><%= meta('description') %></subtitle>
<logo><%= siteBase %>/images/futureporn-icon.png</logo>
<icon><%= siteBase %>/favicon.ico</icon>
<% for (const vod of data.vods) { %>
<%
const url = `${siteBase}/vods/${vod.id}`;
%>
<entry>
<title type="html">
<![CDATA[ <%= vod.title %> ]]>
</title>
<id><%= url %></id>
<link href="<%= url %>" />
<updated><%= new Date(vod.updated) %></updated>
<% if (vod.notes) { %>
<summary type="html">
<![CDATA[ <%= vod.notes %> ]]>
</summary>
<% } %>
</entry>
<% } %>
</feed>

View File

@ -28,9 +28,11 @@
</td>
<td style="width: 160px;">
<% if (vod.thumbnail) { %>
<a href="/vods/<%= vod.id %>#thumbnail" class="is-small is-link">
<figure class="image is-3by2">
<img src="/api/files/<%= vod.collectionId %>/<%= vod.id %>/<%= vod.thumbnail %>?quality=5&width=12" alt="Thumbnail" style="width: 120px; border-radius: 8px;">
<img src="/api/files/<%= vod.collectionId %>/<%= vod.id %>/<%= vod.thumbnail %>?quality=40&width=120" alt="Thumbnail" style="width: 120px; border-radius: 8px;">
</figure>
</a>
<% } else { %>
<span>No thumbnail</span>
<% } %>

View File

@ -1,25 +0,0 @@
// +load.js
/** @type {import('pocketpages').PageDataLoaderFunc} */
module.exports = function (api) {
const { params, response } = api;
try {
const vods = $app.findRecordsByFilter('vods', null, '-streamDate', 25);
$app.expandRecords(vods, ["vtubers"], null);
return { vods };
} catch (e) {
console.error('error!', e.message);
if (e.message.match(/no rows/)) {
console.log('we are sending 404')
return response.html(404, 'VODs not found')
} else {
console.log('we are sending error 500')
return response.html(500, 'Unknown internal error while fetching vods')
}
}
};

View File

@ -1,28 +0,0 @@
// +load.js
/** @type {import('pocketpages').PageDataLoaderFunc} */
module.exports = function (api) {
const { params, response } = api;
try {
const vods = $app.findRecordsByFilter('vods', null, '-streamDate', 99);
$app.expandRecords(vods, ["vtubers"], null);
console.log(JSON.stringify(vods, null, 2))
return { vods };
} catch (e) {
console.error('error!', e.message);
if (e.message.match(/no rows/)) {
console.log('we are sending 404')
return response.html(404, 'VODs not found')
} else {
console.log('we are sending error 500')
return response.html(500, 'Unknown internal error while fetching vods')
}
}
};

View File

@ -1,49 +1,44 @@
<%#
index.ejs — ATOM Feed Generator
Expects: data.vods = [{ id, title, notes, thumbnail, streamDate }]
Expects: data.vods = [{ id, title, notes, thumbnail, streamDate, expand }]
%>
<%=
<%
response.header("Content-Type", "application/atom+xml");
// Build Atom XML as a string
let atom = `<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Futureporn.net</title>
<link href="<%= env('ORIGIN') %>"/>
<title>Futureporn.net VODs</title>
<link href="${env('ORIGIN')}" />
<updated>${new Date().toISOString()}</updated>
<id><%= env('ORIGIN') %></id>
<id>${env('ORIGIN')}</id>
<author>
<name>CJ_Clippy</name>
<email>cj@futureporn.net</email>
</author>`;
for (const vod of data.vods) {
const url = `${env('ORIGIN')}/vods/${vod.id}`;
const entryTitle = ((vod?.get('expand')?.vtubers?.map(vt => vt.get('displayName')) || [])
.join(', ') || vod.get('streamDate'));
const url = `${env('ORIGIN')}/vods/${vod.get('id')}`;
const entryTitle = ((vod?.expand?.vtubers?.map(vt => vt.displayName) || []).join(', ')
|| vod.get('streamDate'));
atom += `
<entry>
<title>
<![CDATA[${entryTitle}]]>
</title>
<title><![CDATA[${((vod?.get('expand')?.vtubers?.map(vt => vt.get('displayName')) || []).join(', ')
|| vod.get('streamDate'))}]]></title>
<link href="${url}" />
<id>${url}</id>
<updated>${vod.get('streamDate')}</updated>`;
<updated>${vod.get('updated')}</updated>`;
if (vod.get('notes')) {
atom += `
<summary type="html">
<![CDATA[${vod.get('notes')}]]>
</summary>`;
<summary type="html"><![CDATA[${vod.get('notes')}]]></summary>`;
}
if (vod.get('thumbnail')) {
atom += `
<content type="image">
<![CDATA[<img src="${vod.get('thumbnail')}" />]]>
</content>`;
<content type="image"><![CDATA[<img src="${env('ORIGIN')}/api/files/vods/${vod.get('id')}/${vod.get('thumbnail')}" />]]></content>`;
}
atom += `
@ -54,5 +49,5 @@ atom += `
</feed>`;
// Send the Atom feed
response.html(200, '<p>HELLO</p>');
response.html(200, atom);
%>

View File

@ -1,28 +0,0 @@
// +load.js
/** @type {import('pocketpages').PageDataLoaderFunc} */
module.exports = function (api) {
const { params, response } = api;
try {
const vods = $app.findRecordsByFilter('vods', null, '-streamDate', 99);
$app.expandRecords(vods, ["vtubers"], null);
console.log(JSON.stringify(vods, null, 2))
return { vods };
} catch (e) {
console.error('error!', e.message);
if (e.message.match(/no rows/)) {
console.log('we are sending 404')
return response.html(404, 'VODs not found')
} else {
console.log('we are sending error 500')
return response.html(500, 'Unknown internal error while fetching vods')
}
}
};

View File

@ -10,12 +10,12 @@ response.header("Content-Type", "application/rss+xml")
let rss = `<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>Futureporn.net</title>
<title>Futureporn.net VODs</title>
<link>https://futureporn.net</link>
<description>Dedication to the preservaton of lewdtuber history</description>
<lastBuildDate>${new Date().toUTCString()}</lastBuildDate>
<docs>https://validator.w3.org/feed/docs/rss2.html</docs>
<generator> </generator>
<generator>pocketpages</generator>
<language>en</language>
<image>
<title>Futureporn.net</title>
@ -34,14 +34,13 @@ for (const vod of data.vods) {
}]]></title>
<link>${url}</link>
<guid>${url}</guid>
<pubDate>${vod.get('streamDate')}</pubDate>`;
if (vod.notes) {
<pubDate>${new Date(vod.get('streamDate')).toUTCString()}</pubDate>`;
if (vod.get('notes')) {
rss += `
<description><![CDATA[${vod.notes}]]></description>`;
<description><![CDATA[${vod.get('notes')}]]></description>`;
}
if (vod.thumbnail) {
rss += `
<enclosure url="${vod.thumbnail}" length="0" type="image/png" />`;
if (vod.get('thumbnail')) {
rss += `<image_link>${env('ORIGIN')}/api/files/vods/${vod.get('id')}/${vod.get('thumbnail')}</image_link>`
}
rss += `
</item>`;