From 1c18ec0593a8ed06f259ccb5ae302e908857789b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=AA=E5=AD=90?= Date: Sat, 27 Jul 2024 09:13:57 +0800 Subject: [PATCH] 0.5.8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 识别豆瓣观影的链接并解析 --- db.php | 26 +++++++++++++ dist/css/style.min.css | 39 ------------------- post.php | 86 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 112 insertions(+), 39 deletions(-) create mode 100644 db.php diff --git a/db.php b/db.php new file mode 100644 index 0000000..0736f20 --- /dev/null +++ b/db.php @@ -0,0 +1,26 @@ + [ + 'ignore_errors' => true, + 'timeout' => 10 // 设置10秒超时 + ] +]); + +$response = file_get_contents($api_url, false, $context); + +if ($response === FALSE) { + header("HTTP/1.1 500 Internal Server Error"); + echo json_encode(['error' => 'Failed to fetch data from API']); +} else { + $responseData = json_decode($response, true); + if (json_last_error() === JSON_ERROR_NONE) { + header('Content-Type: application/json'); + echo $response; + } else { + header("HTTP/1.1 500 Internal Server Error"); + echo json_encode(['error' => 'Invalid JSON response from API']); + } +} diff --git a/dist/css/style.min.css b/dist/css/style.min.css index 0f98d27..200c8ac 100644 --- a/dist/css/style.min.css +++ b/dist/css/style.min.css @@ -235,45 +235,6 @@ border-color: #3f3f46 } -@font-face { - font-family: open sans; - src: url(../fonts/OpenSans-Regular.woff2)format("woff2"), url(../fonts/OpenSans-Regular.woff)format("woff"); - font-weight: 400; - font-style: normal; - font-display: swap -} - -@font-face { - font-family: open sans; - src: url(../fonts/OpenSans-Bold.woff2)format("woff2"), url(../fonts/OpenSans-Bold.woff)format("woff"); - font-weight: 700; - font-style: normal; - font-display: swap -} - -@font-face { - font-family: open sans; - src: url(../fonts/OpenSans-Light.woff2)format("woff2"), url(../fonts/OpenSans-Light.woff)format("woff"); - font-weight: 200; - font-style: normal; - font-display: swap -} - -@font-face { - font-family: open sans; - src: url(../fonts/OpenSans-Medium.woff2)format("woff2"), url(../fonts/OpenSans-Medium.woff)format("woff"); - font-weight: 500; - font-style: normal; - font-display: swap -} - -@font-face { - font-family: mrs_saint_delafieldregular; - src: url(../fonts/mrssaintdelafield-regular-webfont.woff2)format("woff2"), url(../fonts/mrssaintdelafield-regular-webfont.woff)format("woff"); - font-weight: 400; - font-style: normal -} - /*!normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css*/ html { line-height: 1.15; diff --git a/post.php b/post.php index 842e6df..b443fdf 100644 --- a/post.php +++ b/post.php @@ -228,6 +228,92 @@ document.addEventListener('DOMContentLoaded', (event) => { currentList.appendChild(item); }); }); + + need('footer.php'); ?> \ No newline at end of file