ログ表示まで

This commit is contained in:
Gitea
2023-12-07 01:38:24 +09:00
parent ffed28b324
commit 54e614abf8
3 changed files with 56 additions and 1 deletions
+24 -1
View File
@@ -1,6 +1,29 @@
<?php
const LOG_PATH = '/home/miteruzo/Downloads/nizika_broadcast/log.txt';
const LOG_PATH = './log.txt';
$log_data = [];
$f = fopen (LOG_PATH, 'r');
if ($f !== false)
{
while (($dt = fgetcsv ($f, 0, "\t")) !== false)
{
$chat_info = json_decode ($dt[1]);
$log_data[] = ['date_time' => $dt[0],
'chat_icon' => $chat_info -> author -> imageUrl,
'chat_name' => $chat_info -> author -> name,
'chat_message' => $chat_info -> message,
'answer' => $dt[2]];
}
}
fclose ($f);
unset ($f);
require_once './index.frm.php';