Skip to content

Commit

Permalink
アニメまとめのリンクを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
fushihara committed Sep 28, 2024
1 parent 0acca62 commit 1d52b28
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/app/_components/archiveLinkElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 の検索結果へのリンク`;
Expand Down Expand Up @@ -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();
}
Expand Down
3 changes: 3 additions & 0 deletions src/app/_components/navigationHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export function NavigationHeader() {
<li>
<Link href={"/anime/all"}>アニメ一覧</Link>
</li>
<li>
<Link href={"/anime/matome"}>アニメまとめ</Link>
</li>
</ul>
</div>
</div>
Expand Down
78 changes: 78 additions & 0 deletions src/app/anime/matome/page.tsx
Original file line number Diff line number Diff line change
@@ -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<string, string>,
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 (
<div className="p-8 pb-20 gap-16 sm:p-20">
<ul>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "anison", showLinkUnderline: true, })}:アニソンまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "kami_anime", showLinkUnderline: true, })}:神アニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "akuyaku", showLinkUnderline: true, })}:悪役令嬢アニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "tsukkomi", showLinkUnderline: true, })}:ツッコミアニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "binge_watching", showLinkUnderline: true, })}:一気見アニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "youjo", showLinkUnderline: true, })}:幼女アニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "kuso", showLinkUnderline: true, })}:クソアニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "emo", showLinkUnderline: true, })}:エモいアニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "work", showLinkUnderline: true, })}:お仕事アニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "80s", showLinkUnderline: true, })}:懐かしいアニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "adventure", showLinkUnderline: true, })}:冒険ファンタジーアニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "journey", showLinkUnderline: true, })}:旅アニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "sexy", showLinkUnderline: true, })}:セクシーアニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "isekai", showLinkUnderline: true, })}:異世界アニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "renai", showLinkUnderline: true, })}:恋愛アニメ(マンガ原作)まとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "seisyun", showLinkUnderline: true, })}:青春アニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "stronghero", showLinkUnderline: true, })}:主人公最強アニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "battle", showLinkUnderline: true, })}:バトルアニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "90s", showLinkUnderline: true, })}:90年代アニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "harem", showLinkUnderline: true, })}:ハーレムアニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "gag", showLinkUnderline: true, })}:ギャグアニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "nakeru", showLinkUnderline: true, })}:泣けるアニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "guro", showLinkUnderline: true, })}:グロアニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "horror", showLinkUnderline: true, })}:ホラーアニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "utu", showLinkUnderline: true, })}:鬱アニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "eiga", showLinkUnderline: true, })}:アニメ映画まとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "yuri", showLinkUnderline: true, })}:百合アニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "bl", showLinkUnderline: true, })}:BLアニメ(ボーイズラブ)まとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "otome", showLinkUnderline: true, })}:乙女アニメ(ゲーム原作)まとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "otona", showLinkUnderline: true, })}:大人向けアニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "nichijou", showLinkUnderline: true, })}:日常系アニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "lightnovel", showLinkUnderline: true, })}:ラノベアニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "moe", showLinkUnderline: true, })}:萌えアニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "short", showLinkUnderline: true, })}:ショートアニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "imouto", showLinkUnderline: true, })}:妹アニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "dark", showLinkUnderline: true, })}:ダークファンタジーアニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "ikemen", showLinkUnderline: true, })}:イケメンアニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "timeleap", showLinkUnderline: true, })}:タイムリープアニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "zombie", showLinkUnderline: true, })}:ゾンビアニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "key", showLinkUnderline: true, })}:Keyアニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "survival", showLinkUnderline: true, })}:サバイバルアニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "gourmet", showLinkUnderline: true, })}:グルメアニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "tsundere", showLinkUnderline: true, })}:ツンデレアニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "future", showLinkUnderline: true, })}:近未来アニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "esp", showLinkUnderline: true, })}:超能力アニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "idol", showLinkUnderline: true, })}:アイドルアニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "yokai", showLinkUnderline: true, })}:妖怪アニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "sengoku", showLinkUnderline: true, })}:戦国時代アニメまとめ</li>
<li className={className}>{ArciveLinkElement({ type: "AnimeMatome", matomeId: "musical", showLinkUnderline: true, })}:ミュージカルアニメまとめ</li>
</ul>
</div>
);
}
2 changes: 2 additions & 0 deletions src/app/iframe/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 2 additions & 2 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export default function Home() {
https://github.com/fushihara/akiba-souken-archive<br />
このサイトの記事一覧などが欲しい場合は、スクレイピングをするより上記レポジトリからファイルを落としたほうが早いです。<br />
スクレイピングに使ったツール一式は以下の通りです。こちらのスクリプトはdenoを使っています。DLしたhtmlをsqliteに保存して、同じ内容で複数アクセスが起きないように工夫しています。<br />
xxxxx
https://github.com/fushihara/akiba-souken-crawler
<p />
このアーカイブサイトは閉鎖決定時点の全てのコンテンツを網羅している訳ではありません。<br />
通常のarticle形式以外の、投票( https://akiba-souken.com/vote/ )やアニメまとめ( https://akiba-souken.com/anime/matome/ )、アニメランキング( https://akiba-souken.com/anime/ranking/ )は抜けています。<br />
通常のarticle形式以外の、投票( https://akiba-souken.com/vote/ )、アニメランキング( https://akiba-souken.com/anime/ranking/ )は抜けています。<br />
</div>
);
}

0 comments on commit 1d52b28

Please sign in to comment.