elan avatar

feeds

Forked from nws/feeds
Public
Back

Version 2

11/18/2024
import { states } from "https://esm.town/v/jordan/states";

export default async function (req: Request): Promise<Response> {
const url = new URL(req.url);
const path = url.pathname;
const params = url.searchParams;

const endpoint = "https://nws-feeds.web.val.run";
const did = "did:plc:nv3ovrjydkgcuoqtnn5porlf";

if (path === "/") {
return new Response(
`<!DOCTYPE html><html><head><style>:root {color-scheme: light dark;}body {font-family: Arial, sans-serif;}</style><meta name="viewport" content="width=device-width, initial-scale=1" /></head>
<body><h1>Bluesky Feed: Posts Without 'E'</h1>
<p>This feed includes all Bluesky posts that do not contain the letter 'E'.</p>
<ul>
<li><a href="/xrpc/app.bsky.feed.getFeedSkeleton"><code>/xrpc/app.bsky.feed.getFeedSkeleton</code></a></li>
</ul></body></html>`,
{ headers: { "Content-Type": "text/html;charset=utf-8" } }
);
}

if (path === "/.well-known/did.json") {
return new Response(
`{"id":"did:web:${new URL(endpoint).host}","service":[{"id":"#bsky_fg","type":"BskyFeedGenerator","serviceEndpoint":"${endpoint}"}]}`,
{ headers: { "Content-Type": "application/json" } }
);
}

if (path === "/xrpc/app.bsky.feed.describeFeedGenerator") {
return new Response(
JSON.stringify({
did: `did:web:${new URL(endpoint).host}`,
feeds: [
{ uri: `at://${did}/app.bsky.feed.generator/no-e` },
],
elan-feeds.web.val.run
Updated: November 18, 2024