/**
* 聚合阅读 PHP 嵌入版 (Secure V2)
* 作用:在您的网站上展示订阅的 RSS 文章
* 配置:无需修改,包含自动缓存与 Token 校验
*/
date_default_timezone_set('Asia/Shanghai');
$config_uid = '46474';
$config_token = '6575d0e5220b6cef0c713f5ab6f8940e';
$config_api = 'https://lilog.cn/is/index.php?action=get_user_feeds&uid=' . $config_uid . '&token=' . $config_token . '&limit=30';
$cache_time = 5400; // 90分钟缓存
$cache_file = __DIR__ . '/rss_cache_' . $config_uid . '.json';
$data = null;
if (file_exists($cache_file) && (time() - filemtime($cache_file) < $cache_time)) { $raw = @file_get_contents($cache_file); $json = json_decode($raw, true); if ($json) $data = $json; } if (!$data) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $config_api); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 10); // 自动携带 Referer 进行白名单校验 curl_setopt($ch, CURLOPT_REFERER, (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $res = curl_exec($ch); curl_close($ch); $json = json_decode($res, true); if ($json && isset($json['status']) && $json['status'] === 'success') { $data = $json['data']; @file_put_contents($cache_file, json_encode($data)); } } ?>
$has_ai = !empty($item['ai_summary']);
$ai_summary_text = $has_ai ? $item['ai_summary'] : '';
?>