First commit.

このコミットが含まれているのは:
2022-07-04 07:20:06 +09:00
コミット 5975a43132
2個のファイルの変更62行の追加0行の削除

41
index.php ノーマルファイル
ファイルの表示

@ -0,0 +1,41 @@
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<?php
if (isset($_GET['status']) && $_GET['status'] != '') {
$stat = htmlspecialchars($_GET['status']);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://social.076.ne.jp/api/v1/statuses/'.$stat.'/context');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
$get = curl_exec($ch);
curl_close($ch);
$comment = json_decode($get)->descendants;
?>
<div class="comment-head">Comments (<?php echo count($comment); ?>)</div>
<?php
foreach ($comment as $c) {
?>
<hr />
<div class="comment-meta">
<span class="comment-icon"><img style="max-width: 25px; max-height: 25px;" src="<?php echo $c->account->avatar_static; ?>" alt="<?php echo $c->account->display_name ?>'s icon" /></span>
<span class="comment-auth"><a href="<?php echo $c->account->url; ?>"><?php echo $c->account->display_name; ?> (<?php echo $c->account->fqn ?>)</a></span>
<div class="comment-date"><?php echo date('Y/m/d, H:i:s', strtotime($c->account->created_at)); ?></div>
</div>
<div class="comment-body">
<?php echo $c->content; ?>
</div>
<?php
}
}
?>
</body>
</html>

21
style.css ノーマルファイル
ファイルの表示

@ -0,0 +1,21 @@
.comment-date, .comment-body, .comment-head {
color: #f66;
}
a {
color: #aa0;
}
hr {
color: #e9e967;
}
.comment-head {
font-size: 24px;
font-weight: bolder;
}
.comment-meta {
background-color: rgba(100, 0, 0, 0.3);
padding: 4px;
}