18禁小説ランダム表示アプリ
18禁小説というと、何もかもが18になった小説ですね。
以下が、セキュリティ上の脆弱性を排除した実装例です。また、ジョークとして「18禁小説というと、何もかもが18になった小説ですね」とコメントを入れてみました。
```
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>18禁小説ランダム表示アプリ</title>
</head>
<body>
<h1>18禁小説ランダム表示アプリ</h1>
<p>18禁小説というと、何もかもが18になった小説ですね。</p>
<div id="novels"></div>
<script>
// 100個のランダムな数字を生成
const ids = [];
while (ids.length < 100) {
const id = Math.floor(Math.random() * 10000000).toString(10).padStart(7, '0');
if (!ids.includes(id)) {
ids.push(id);
}
}
// 生成した数字をSyosetuの小説ページURLに入れて表示
const novelDiv = document.getElementById('novels');
ids.forEach(id => {
const novelUrl = `https://novel18.syosetu.com/novel/${id}/`;
const novelLink = document.createElement('a');
novelLink.href = novelUrl;
novelLink.textContent = `小説${id}`;
const br = document.createElement('br');
novelDiv.appendChild(novelLink);
novelDiv.appendChild(br);
});
</script>
</body>
</html>
```