From 1d52b28e394983a8346e0ccb7ec1ed6b54dd6918 Mon Sep 17 00:00:00 2001 From: Fushihara <1039534+fushihara@users.noreply.github.com> Date: Sat, 28 Sep 2024 19:47:44 +0900 Subject: =?UTF-8?q?=E3=82=A2=E3=83=8B=E3=83=A1=E3=81=BE=E3=81=A8=E3=82=81?= =?UTF-8?q?=E3=81=AE=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/_components/archiveLinkElement.tsx | 9 +++- src/app/_components/navigationHeader.tsx | 3 ++ src/app/anime/matome/page.tsx | 78 ++++++++++++++++++++++++++++++ src/app/iframe/page.tsx | 2 + src/app/page.tsx | 4 +- 5 files changed, 93 insertions(+), 3 deletions(-) create mode 100644 src/app/anime/matome/page.tsx diff --git a/src/app/_components/archiveLinkElement.tsx b/src/app/_components/archiveLinkElement.tsx index d97d904..94daed5 100644 --- a/src/app/_components/archiveLinkElement.tsx +++ b/src/app/_components/archiveLinkElement.tsx @@ -19,8 +19,12 @@ type AnimeReviewItem = { animeId: number, reviewId: number, }; +type AnimeMatome = { + type: "AnimeMatome", + matomeId: string, +}; type Common = { showLinkUnderline?: boolean } -type Option = (ArticlePage | AnimeTop | AnimeReviewList | AnimeReviewItem) & Common; +type Option = (ArticlePage | AnimeTop | AnimeReviewList | AnimeReviewItem | AnimeMatome) & Common; export function ArciveLinkElement(option: Option) { const officialLinkTitle = `公式のakiba-souken.com へのリンク。閉鎖後は繋がらなくなるはず`; const iaSearchResultLinkTitle = `InternetArchive の検索結果へのリンク`; @@ -53,6 +57,9 @@ export function ArciveLinkElement(option: Option) { } else if (option.type == "AnimeReviewItem") { originalUrl = `https://akiba-souken.com/anime/${option.animeId}/review/${option.reviewId}`; iframeSrc = `anime-${option.animeId}-review-${option.reviewId}`; + } else if (option.type == "AnimeMatome") { + originalUrl = `https://akiba-souken.com/anime/matome/${option.matomeId}/`; + iframeSrc = `anime-matome-${option.matomeId}`; } else { throw new Error(); } diff --git a/src/app/_components/navigationHeader.tsx b/src/app/_components/navigationHeader.tsx index 20cee95..7c4f4f3 100644 --- a/src/app/_components/navigationHeader.tsx +++ b/src/app/_components/navigationHeader.tsx @@ -24,6 +24,9 @@ export function NavigationHeader() {
  • アニメ一覧
  • +
  • + アニメまとめ +
  • diff --git a/src/app/anime/matome/page.tsx b/src/app/anime/matome/page.tsx new file mode 100644 index 0000000..5437707 --- /dev/null +++ b/src/app/anime/matome/page.tsx @@ -0,0 +1,78 @@ +import dateformat from "dateformat"; +import { AnimeLoader, AnimeLoaderData } from "../../../util/animeLoader"; +import { ArciveLinkElement } from "../../_components/archiveLinkElement"; +dateformat.i18n.dayNames = [ + '日', '月', '火', '水', '木', '金', '土', + '日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日' +]; +type PageType = { + searchParams: Record, + params: { animeId: string, } +} +export async function generateMetadata(context: PageType) { + const loadedData = await AnimeLoader.instance.loadData().then(d => { + const r = d.find(a => a.animeId == Number(context.params.animeId))!; + return r; + }); + return { + title: `アキバ総研アーカイブ:アニメまとめ`, + } +} +export default async function Page(context: PageType) { + const className = "flex gap-4"; + return ( +
    + +
    + ); +} diff --git a/src/app/iframe/page.tsx b/src/app/iframe/page.tsx index e26e921..985671a 100644 --- a/src/app/iframe/page.tsx +++ b/src/app/iframe/page.tsx @@ -47,6 +47,8 @@ function parseParam(paramString: string) { return `https://akiba-souken.com/anime/${m[1]}/review/?page=${m[2]}`; } else if (m = paramString.match(/^anime-(\d+)-review-(\d+)$/)) { return `https://akiba-souken.com/anime/${m[1]}/review/${m[2]}/`; + } else if (m = paramString.match(/^anime-matome-(.+?)$/)) { + return `https://akiba-souken.com/anime/matome/${m[1]}/`; } return null; } diff --git a/src/app/page.tsx b/src/app/page.tsx index 58a7429..2ca4873 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -21,10 +21,10 @@ export default function Home() { https://github.com/fushihara/akiba-souken-archive
    このサイトの記事一覧などが欲しい場合は、スクレイピングをするより上記レポジトリからファイルを落としたほうが早いです。
    スクレイピングに使ったツール一式は以下の通りです。こちらのスクリプトはdenoを使っています。DLしたhtmlをsqliteに保存して、同じ内容で複数アクセスが起きないように工夫しています。
    - xxxxx + https://github.com/fushihara/akiba-souken-crawler

    このアーカイブサイトは閉鎖決定時点の全てのコンテンツを網羅している訳ではありません。
    - 通常のarticle形式以外の、投票( https://akiba-souken.com/vote/ )やアニメまとめ( https://akiba-souken.com/anime/matome/ )、アニメランキング( https://akiba-souken.com/anime/ranking/ )は抜けています。
    + 通常のarticle形式以外の、投票( https://akiba-souken.com/vote/ )、アニメランキング( https://akiba-souken.com/anime/ranking/ )は抜けています。
    ); } -- cgit v1.2.3