Compare commits
2 Commits
91eff4ad07
...
cd335a366e
Author | SHA1 | Date | |
---|---|---|---|
cd335a366e | |||
b307d4de03 |
4
feeds.ts
4
feeds.ts
@ -34,7 +34,7 @@ export async function profileAtomFeed(
|
|||||||
|
|
||||||
return `
|
return `
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:nostr="urn:nostr:protocol">
|
||||||
<title>${profile.name} on Nostr (Articles)</title>
|
<title>${profile.name} on Nostr (Articles)</title>
|
||||||
<link rel="alternate" type="text/html" href="${profile.profileUrl}" />
|
<link rel="alternate" type="text/html" href="${profile.profileUrl}" />
|
||||||
<link rel="alternate" type="application/nostr+json" href="nostr:${profile.npub}" />
|
<link rel="alternate" type="application/nostr+json" href="nostr:${profile.npub}" />
|
||||||
@ -44,7 +44,7 @@ export async function profileAtomFeed(
|
|||||||
<author>
|
<author>
|
||||||
<name>${profile.name}</name>
|
<name>${profile.name}</name>
|
||||||
<uri>${profile.profileUrl}</uri>
|
<uri>${profile.profileUrl}</uri>
|
||||||
<nostr:uri>nostr:${profile.nprofile}</nostr>
|
<nostr:uri>nostr:${profile.nprofile}</nostr:uri>
|
||||||
</author>
|
</author>
|
||||||
${articlesXml}
|
${articlesXml}
|
||||||
</feed>
|
</feed>
|
||||||
|
@ -4,6 +4,7 @@ import { fetchArticlesByAuthor, fetchProfileEvent } from "../nostr.ts";
|
|||||||
import { profileAtomFeed } from "../feeds.ts";
|
import { profileAtomFeed } from "../feeds.ts";
|
||||||
import Profile from "../models/profile.ts";
|
import Profile from "../models/profile.ts";
|
||||||
import { notFoundHandler } from "../handlers/errors.ts";
|
import { notFoundHandler } from "../handlers/errors.ts";
|
||||||
|
import { generateOgProfileImage } from "../magick.ts";
|
||||||
|
|
||||||
const userAtomFeedHandler = async function (ctx: Context) {
|
const userAtomFeedHandler = async function (ctx: Context) {
|
||||||
const username = ctx.state.username;
|
const username = ctx.state.username;
|
||||||
@ -20,6 +21,7 @@ const userAtomFeedHandler = async function (ctx: Context) {
|
|||||||
const profile = new Profile(profileEvent, username);
|
const profile = new Profile(profileEvent, username);
|
||||||
|
|
||||||
if (profile.nip05) {
|
if (profile.nip05) {
|
||||||
|
await generateOgProfileImage(profile);
|
||||||
const articles = await fetchArticlesByAuthor(pubkey, 10);
|
const articles = await fetchArticlesByAuthor(pubkey, 10);
|
||||||
const atom = await profileAtomFeed(profile, articles);
|
const atom = await profileAtomFeed(profile, articles);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user