feat: 環境変数を使用してRSSフィード設定を構成
This commit is contained in:
		@@ -7,3 +7,12 @@ VOICEVOX_STYLE_ID=2
 | 
			
		||||
OPENAI_API_KEY=your-openai-api-key
 | 
			
		||||
OPENAI_API_ENDPOINT=https://api.openai.com/v1
 | 
			
		||||
OPENAI_MODEL_NAME=gpt-4o-mini
 | 
			
		||||
 | 
			
		||||
# RSSフィードの設定
 | 
			
		||||
PODCAST_TITLE=自動生成ポッドキャスト
 | 
			
		||||
PODCAST_LINK=https://your-domain.com/podcast
 | 
			
		||||
PODCAST_DESCRIPTION=RSSフィードから自動生成された音声ポッドキャスト
 | 
			
		||||
PODCAST_LANGUAGE=ja
 | 
			
		||||
PODCAST_AUTHOR=管理者
 | 
			
		||||
PODCAST_CATEGORIES=Technology
 | 
			
		||||
PODCAST_TTL=60
 | 
			
		||||
 
 | 
			
		||||
@@ -5,9 +5,14 @@ import { Episode, fetchAllEpisodes } from "./database";
 | 
			
		||||
export async function updatePodcastRSS() {
 | 
			
		||||
  const episodes: Episode[] = await fetchAllEpisodes();
 | 
			
		||||
 | 
			
		||||
  const channelTitle = "自動生成ポッドキャスト";
 | 
			
		||||
  const channelLink = "https://your-domain.com/podcast";
 | 
			
		||||
  const channelDescription = "RSSフィードから自動生成されたポッドキャストです。";
 | 
			
		||||
  const channelTitle = process.env.PODCAST_TITLE ?? "自動生成ポッドキャスト";
 | 
			
		||||
  const channelLink = process.env.PODCAST_LINK ?? "https://your-domain.com/podcast";
 | 
			
		||||
  const channelDescription =
 | 
			
		||||
    process.env.PODCAST_DESCRIPTION ?? "RSSフィードから自動生成された音声ポッドキャスト";
 | 
			
		||||
  const channelLanguage = process.env.PODCAST_LANGUAGE ?? "ja";
 | 
			
		||||
  const channelAuthor = process.env.PODCAST_AUTHOR ?? "管理者";
 | 
			
		||||
  const channelCategories = process.env.PODCAST_CATEGORIES ?? "Technology";
 | 
			
		||||
  const channelTTL = process.env.PODCAST_TTL ?? "60";
 | 
			
		||||
  const lastBuildDate = new Date().toUTCString();
 | 
			
		||||
 | 
			
		||||
  let itemsXml = "";
 | 
			
		||||
@@ -28,9 +33,9 @@ export async function updatePodcastRSS() {
 | 
			
		||||
  const rssXml = `<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
  <rss version="2.0">
 | 
			
		||||
    <channel>
 | 
			
		||||
      <title><![CDATA[${channelTitle}]]></title>
 | 
			
		||||
      <title>${channelTitle}</title>
 | 
			
		||||
      <link>${channelLink}</link>
 | 
			
		||||
      <description><![CDATA[${channelDescription}]]></description>
 | 
			
		||||
      <description>${channelDescription}]]></description>
 | 
			
		||||
      <lastBuildDate>${lastBuildDate}</lastBuildDate>
 | 
			
		||||
      ${itemsXml}
 | 
			
		||||
    </channel>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user