Compare commits
No commits in common. "69310e8229d65f0f69fefd43227ccc7029a0f8b2" and "665b7ea924bd11eabdf30d69eaea0cb424175463" have entirely different histories.
69310e8229
...
665b7ea924
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "futureporn",
|
"name": "futureporn",
|
||||||
"version": "3.4.0",
|
"version": "3.3.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Dedication to the preservation of lewdtuber history",
|
"description": "Dedication to the preservation of lewdtuber history",
|
||||||
"license": "Unlicense",
|
"license": "Unlicense",
|
||||||
|
|||||||
@ -75,9 +75,7 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
<div class="container">
|
<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="notification is-info">Hello World</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
|
|||||||
@ -50,30 +50,30 @@
|
|||||||
<% if (vtubers.length === 0) { %>None<% } %>
|
<% if (vtubers.length === 0) { %>None<% } %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p><b id="stream-date">Stream Date:</b> <%= data.vod?.get('streamDate') ?? 'Unknown date' %></p>
|
<p><b>Stream Date:</b> <%= data.vod?.get('streamDate') ?? 'Unknown date' %></p>
|
||||||
|
|
||||||
<% if (data.vod?.get('announceUrl')) { %>
|
<% if (data.vod?.get('announceUrl')) { %>
|
||||||
<p>
|
<p>
|
||||||
<b id="announce-url">Announce URL:</b>
|
<b>Announce URL:</b>
|
||||||
<a href="<%= data.vod?.get('announceUrl') %>"><%= data.vod?.get('announceUrl') %></a>
|
<a href="<%= data.vod?.get('announceUrl') %>"><%= data.vod?.get('announceUrl') %></a>
|
||||||
</p>
|
</p>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
<% if (data.vod?.get('ipfsCid')) { %>
|
<% if (data.vod?.get('ipfsCid')) { %>
|
||||||
<p><b id="ipfs-cid">IPFS CID:</b> <%= data.vod?.get('ipfsCid') %></p>
|
<p><b>IPFS CID:</b> <%= data.vod?.get('ipfsCid') %></p>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
<% if (data.vod?.get('magnetLink')) { %>
|
<% if (data.vod?.get('magnetLink')) { %>
|
||||||
<p><b id="magnet-link">Magnet Link:</b> <%= data.vod?.get('magnetLink') %></p>
|
<p><b>Magnet Link:</b> <%= data.vod?.get('magnetLink') %></p>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
<% if (data.vod?.get('notes')) { %>
|
<% if (data.vod?.get('notes')) { %>
|
||||||
<p><b id="notes">Notes:</b></p>
|
<p><b>Notes:</b></p>
|
||||||
<div class="p-2 level"><%- data.vod?.get('notes') %></div>
|
<div class="p-2 level"><%- data.vod?.get('notes') %></div>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
<% if (data.vod?.get('thumbnail')) { %>
|
<% if (data.vod?.get('thumbnail')) { %>
|
||||||
<p><b id="thumbnail">Thumbnail:</b></p>
|
<p><b>Thumbnail:</b></p>
|
||||||
<figure class="image">
|
<figure class="image">
|
||||||
<img src="/api/files/vods/<%= data.vod?.get('id') %>/<%= data.vod?.get('thumbnail') %>" />
|
<img src="/api/files/vods/<%= data.vod?.get('id') %>/<%= data.vod?.get('thumbnail') %>" />
|
||||||
</figure>
|
</figure>
|
||||||
|
|||||||
@ -0,0 +1,26 @@
|
|||||||
|
// +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')
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
<%#
|
||||||
|
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>
|
||||||
@ -28,11 +28,9 @@
|
|||||||
</td>
|
</td>
|
||||||
<td style="width: 160px;">
|
<td style="width: 160px;">
|
||||||
<% if (vod.thumbnail) { %>
|
<% if (vod.thumbnail) { %>
|
||||||
<a href="/vods/<%= vod.id %>#thumbnail" class="is-small is-link">
|
<figure class="image is-3by2">
|
||||||
<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>
|
||||||
</figure>
|
|
||||||
</a>
|
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
<span>No thumbnail</span>
|
<span>No thumbnail</span>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|||||||
25
services/pocketbase/pb_hooks/pages/vods/feed.json/+load.js
Normal file
25
services/pocketbase/pb_hooks/pages/vods/feed.json/+load.js
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
// +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')
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
28
services/pocketbase/pb_hooks/pages/vods/feed.xml/+load.js
Normal file
28
services/pocketbase/pb_hooks/pages/vods/feed.xml/+load.js
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
// +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')
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
@ -1,53 +1,58 @@
|
|||||||
<%#
|
<%#
|
||||||
index.ejs — ATOM Feed Generator
|
index.ejs — ATOM Feed Generator
|
||||||
Expects: data.vods = [{ id, title, notes, thumbnail, streamDate, expand }]
|
Expects: data.vods = [{ id, title, notes, thumbnail, streamDate }]
|
||||||
%>
|
%>
|
||||||
|
|
||||||
<%
|
<%=
|
||||||
response.header("Content-Type", "application/atom+xml");
|
response.header("Content-Type", "application/atom+xml");
|
||||||
|
|
||||||
// Build Atom XML as a string
|
// Build Atom XML as a string
|
||||||
let atom = `<?xml version="1.0" encoding="utf-8"?>
|
let atom = `<?xml version="1.0" encoding="utf-8"?>
|
||||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||||
<title>Futureporn.net VODs</title>
|
<title>Futureporn.net</title>
|
||||||
<link href="${env('ORIGIN')}" />
|
<link href="<%= env('ORIGIN') %>"/>
|
||||||
<updated>${new Date().toISOString()}</updated>
|
<updated>${new Date().toISOString()}</updated>
|
||||||
<id>${env('ORIGIN')}</id>
|
<id><%= env('ORIGIN') %></id>
|
||||||
<author>
|
<author>
|
||||||
<name>CJ_Clippy</name>
|
<name>CJ_Clippy</name>
|
||||||
<email>cj@futureporn.net</email>
|
<email>cj@futureporn.net</email>
|
||||||
</author>`;
|
</author>`;
|
||||||
|
|
||||||
for (const vod of data.vods) {
|
for (const vod of data.vods) {
|
||||||
const url = `${env('ORIGIN')}/vods/${vod.get('id')}`;
|
const url = `${env('ORIGIN')}/vods/${vod.id}`;
|
||||||
const entryTitle = ((vod?.expand?.vtubers?.map(vt => vt.displayName) || []).join(', ')
|
const entryTitle = ((vod?.get('expand')?.vtubers?.map(vt => vt.get('displayName')) || [])
|
||||||
|| vod.get('streamDate'));
|
.join(', ') || vod.get('streamDate'));
|
||||||
|
|
||||||
atom += `
|
atom += `
|
||||||
<entry>
|
<entry>
|
||||||
<title><![CDATA[${((vod?.get('expand')?.vtubers?.map(vt => vt.get('displayName')) || []).join(', ')
|
<title>
|
||||||
|| vod.get('streamDate'))}]]></title>
|
<![CDATA[${entryTitle}]]>
|
||||||
<link href="${url}" />
|
</title>
|
||||||
<id>${url}</id>
|
<link href="${url}" />
|
||||||
<updated>${vod.get('updated')}</updated>`;
|
<id>${url}</id>
|
||||||
|
<updated>${vod.get('streamDate')}</updated>`;
|
||||||
|
|
||||||
if (vod.get('notes')) {
|
if (vod.get('notes')) {
|
||||||
atom += `
|
atom += `
|
||||||
<summary type="html"><![CDATA[${vod.get('notes')}]]></summary>`;
|
<summary type="html">
|
||||||
|
<![CDATA[${vod.get('notes')}]]>
|
||||||
|
</summary>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vod.get('thumbnail')) {
|
if (vod.get('thumbnail')) {
|
||||||
atom += `
|
atom += `
|
||||||
<content type="image"><![CDATA[<img src="${env('ORIGIN')}/api/files/vods/${vod.get('id')}/${vod.get('thumbnail')}" />]]></content>`;
|
<content type="image">
|
||||||
|
<![CDATA[<img src="${vod.get('thumbnail')}" />]]>
|
||||||
|
</content>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
atom += `
|
atom += `
|
||||||
</entry>`;
|
</entry>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
atom += `
|
atom += `
|
||||||
</feed>`;
|
</feed>`;
|
||||||
|
|
||||||
// Send the Atom feed
|
// Send the Atom feed
|
||||||
response.html(200, atom);
|
response.html(200, '<p>HELLO</p>');
|
||||||
%>
|
%>
|
||||||
28
services/pocketbase/pb_hooks/pages/vods/rss.xml/+load.js
Normal file
28
services/pocketbase/pb_hooks/pages/vods/rss.xml/+load.js
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
// +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')
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
@ -10,12 +10,12 @@ response.header("Content-Type", "application/rss+xml")
|
|||||||
let rss = `<?xml version="1.0" encoding="utf-8"?>
|
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/">
|
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
|
||||||
<channel>
|
<channel>
|
||||||
<title>Futureporn.net VODs</title>
|
<title>Futureporn.net</title>
|
||||||
<link>https://futureporn.net</link>
|
<link>https://futureporn.net</link>
|
||||||
<description>Dedication to the preservaton of lewdtuber history</description>
|
<description>Dedication to the preservaton of lewdtuber history</description>
|
||||||
<lastBuildDate>${new Date().toUTCString()}</lastBuildDate>
|
<lastBuildDate>${new Date().toUTCString()}</lastBuildDate>
|
||||||
<docs>https://validator.w3.org/feed/docs/rss2.html</docs>
|
<docs>https://validator.w3.org/feed/docs/rss2.html</docs>
|
||||||
<generator>pocketpages</generator>
|
<generator> </generator>
|
||||||
<language>en</language>
|
<language>en</language>
|
||||||
<image>
|
<image>
|
||||||
<title>Futureporn.net</title>
|
<title>Futureporn.net</title>
|
||||||
@ -34,13 +34,14 @@ for (const vod of data.vods) {
|
|||||||
}]]></title>
|
}]]></title>
|
||||||
<link>${url}</link>
|
<link>${url}</link>
|
||||||
<guid>${url}</guid>
|
<guid>${url}</guid>
|
||||||
<pubDate>${new Date(vod.get('streamDate')).toUTCString()}</pubDate>`;
|
<pubDate>${vod.get('streamDate')}</pubDate>`;
|
||||||
if (vod.get('notes')) {
|
if (vod.notes) {
|
||||||
rss += `
|
rss += `
|
||||||
<description><![CDATA[${vod.get('notes')}]]></description>`;
|
<description><![CDATA[${vod.notes}]]></description>`;
|
||||||
}
|
}
|
||||||
if (vod.get('thumbnail')) {
|
if (vod.thumbnail) {
|
||||||
rss += `<image_link>${env('ORIGIN')}/api/files/vods/${vod.get('id')}/${vod.get('thumbnail')}</image_link>`
|
rss += `
|
||||||
|
<enclosure url="${vod.thumbnail}" length="0" type="image/png" />`;
|
||||||
}
|
}
|
||||||
rss += `
|
rss += `
|
||||||
</item>`;
|
</item>`;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user