<script>
import { onMount } from "svelte";
import { Relay } from "nostr-tools/relay";
let feed = $state("");
let podcast =$state({})
$effect(() => {
if(feed){
console.log(parser)
const parserOptions = {
attributeNamePrefix: '@_',
//attrNodeName: false,
//textNodeName : "#text",
ignoreAttributes: false,
ignoreNameSpace: false,
};
let xml2Json = parser.parse(feed, parserOptions);
podcast = xml2Json.rss.channel
}
});
async function fetchFeed(eventId, publicKey) {
// Connect to the relay using the native WebSocket
const relay = await Relay.connect("wss://relay.nostr.band/");
console.log(`connected to ${relay.url}`);
// Subscribe to events based on event ID and public key
relay.subscribe(
[