diff --git a/.idea/.gitignore b/.idea/.gitignore
deleted file mode 100644
index 35410ca..0000000
--- a/.idea/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# 默认忽略的文件
-/shelf/
-/workspace.xml
-# 基于编辑器的 HTTP 客户端请求
-/httpRequests/
-# Datasource local storage ignored files
-/dataSources/
-/dataSources.local.xml
diff --git a/.idea/lylme_spage.iml b/.idea/lylme_spage.iml
deleted file mode 100644
index d6ebd48..0000000
--- a/.idea/lylme_spage.iml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index 639900d..0000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index 5e1de72..0000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 35eb1dd..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/assets/img/cron.php b/assets/img/cron.php
index 8e6fc54..1cacc92 100644
--- a/assets/img/cron.php
+++ b/assets/img/cron.php
@@ -1,59 +1,123 @@
- 请求示例:https://域名/assets/img/cron.php?key=adsij' . $_SERVER['HTTP_HOST'] . '/assets/img/cron.php?key=秘钥');
-} else if ($pass != $_GET['key']) {
- exit('错误:传入参数key与密钥不匹配');
-} else {
- // 密钥正确,执行下面代码
-
- /**
- * PHP下载NASA APOD每日高清图片并保存为background.jpg
- */
-
- $api_key = ''; // 替换成你的NASA API密钥
- $apod_url = 'https://api.nasa.gov/planetary/apod?api_key=' . $api_key;
- $json_content = file_get_contents($apod_url);
- $data = json_decode($json_content);
-
- if ($data && isset($data->hdurl)) {
- $hdurl = $data->hdurl;
-
- echo "高清图片地址:" . $hdurl . "
";
-
- /**
- * 下载高清图片并保存为background.jpg
- */
- function DownloadAndSaveImage($imgurl, $dir, $filename = '/background.jpg')
- {
- if (empty($imgurl)) {
- return false;
- }
-
- $dir = realpath($dir);
- $filename = $dir . $filename;
-
- $img_content = file_get_contents($imgurl);
-
- if ($img_content !== false) {
- file_put_contents($filename, $img_content);
- echo "成功:高清图片已下载并保存为 " . $filename . "
";
- } else {
- echo "
错误:下载图片失败
";
- }
- }
-
- DownloadAndSaveImage($hdurl, dirname(__FILE__));
- } else {
- echo "错误:未能获取到高清图片地址
";
- }
}
-?>
+else if (empty($_GET['key'])) {
+ //未传入key
+ exit('错误:密钥为空,请传入包含参数key的GET请求
+ 请求示例:http://'.$_SERVER['HTTP_HOST'].'/assets/img/cron.php?key=秘钥');
+}
+else if($pass != $_GET['key']){
+ //密钥错误
+ exit('错误:传入参数key与密钥不匹配');
+}
+else {
+ //密钥正确,执行下面代码
+/**
+ * PHP获取bing每日壁纸
+ * bing每日壁纸更新时间为UTC+8 16:00
+ */
+
+if($_GET['idx']==null){
+$str=file_get_contents('http://cn.bing.com/HPImageArchive.aspx?idx=0&n=1');
+//
+
+}
+else{
+ $str=file_get_contents('http://cn.bing.com/HPImageArchive.aspx?idx='.$_GET['idx'].'&n=1');
+}
+
+if(preg_match("/(.+?)<\/url>/is",$str,$matches)){
+
+if(preg_match("/(.+?)<\/fullstartdate>/is",$str,$cdata)){
+
+}
+$crdate = date('Y年m月d日 H:i', strtotime($cdata[1]));
+$imgurl = 'http://cn.bing.com'.$matches[1];
+
+ echo "壁纸地址:" . $imgurl."
";
+ echo "发布时间:" . $crdate."
";
+
+}
+
+
+/**
+ * 将bing每日壁纸保存到 当前目录/background.jpg
+ */
+function GrabImage($imgurl, $dir, $filename='/background.jpg'){
+ if(empty($imgurl)){
+ return false;
+ }
+ $ext = strrchr($imgurl, '.');
+ if($ext == '.js' && $ext == ".html" && $ext == ".php"){
+ echo "Format not supported!";
+ return false;
+ }
+
+ $dir = realpath($dir);
+
+
+ $filename = $dir . $filename;
+
+ ob_start();
+ readfile($imgurl);
+ $img = ob_get_contents();
+ ob_end_clean();
+ $size = strlen($img);
+
+ $fp2 = fopen($filename , "w");
+ if(fwrite($fp2, $img)==true){
+ echo "壁纸大小:" . round($size / 1024) .'KB
';
+
+ echo "成功:当前壁纸已与Bing同步!
";
+
+ }
+ else{
+ echo "错误: 保存文件 ". $filename." 失败,请检查目录权限
";
+
+ }
+ fclose($fp2);
+
+// echo "保存路径:" . $filename."
";
+
+ return $filename;
+}
+
+
+GrabImage($imgurl,dirname(__FILE__));
+
+
+/**
+ * 返回bing每日壁纸
+ */
+// if($imgurl){
+// header('Content-Type: image/JPEG');
+// @ob_end_clean();
+// @readfile($imgurl);
+// @flush(); @ob_flush();
+// exit();
+// }else{
+// exit('error');
+// }
+}
+?>
\ No newline at end of file
diff --git a/assets/img/cron_old.php b/assets/img/cron_old.php
deleted file mode 100644
index 1cacc92..0000000
--- a/assets/img/cron_old.php
+++ /dev/null
@@ -1,123 +0,0 @@
-
- 请求示例:http://'.$_SERVER['HTTP_HOST'].'/assets/img/cron.php?key=秘钥');
-}
-else if($pass != $_GET['key']){
- //密钥错误
- exit('错误:传入参数key与密钥不匹配');
-}
-else {
- //密钥正确,执行下面代码
-
-/**
- * PHP获取bing每日壁纸
- * bing每日壁纸更新时间为UTC+8 16:00
- */
-
-if($_GET['idx']==null){
-$str=file_get_contents('http://cn.bing.com/HPImageArchive.aspx?idx=0&n=1');
-//
-
-}
-else{
- $str=file_get_contents('http://cn.bing.com/HPImageArchive.aspx?idx='.$_GET['idx'].'&n=1');
-}
-
-if(preg_match("/(.+?)<\/url>/is",$str,$matches)){
-
-if(preg_match("/(.+?)<\/fullstartdate>/is",$str,$cdata)){
-
-}
-$crdate = date('Y年m月d日 H:i', strtotime($cdata[1]));
-$imgurl = 'http://cn.bing.com'.$matches[1];
-
- echo "壁纸地址:" . $imgurl."
";
- echo "发布时间:" . $crdate."
";
-
-}
-
-
-/**
- * 将bing每日壁纸保存到 当前目录/background.jpg
- */
-function GrabImage($imgurl, $dir, $filename='/background.jpg'){
- if(empty($imgurl)){
- return false;
- }
- $ext = strrchr($imgurl, '.');
- if($ext == '.js' && $ext == ".html" && $ext == ".php"){
- echo "Format not supported!";
- return false;
- }
-
- $dir = realpath($dir);
-
-
- $filename = $dir . $filename;
-
- ob_start();
- readfile($imgurl);
- $img = ob_get_contents();
- ob_end_clean();
- $size = strlen($img);
-
- $fp2 = fopen($filename , "w");
- if(fwrite($fp2, $img)==true){
- echo "壁纸大小:" . round($size / 1024) .'KB
';
-
- echo "成功:当前壁纸已与Bing同步!
";
-
- }
- else{
- echo "错误: 保存文件 ". $filename." 失败,请检查目录权限
";
-
- }
- fclose($fp2);
-
-// echo "保存路径:" . $filename."
";
-
- return $filename;
-}
-
-
-GrabImage($imgurl,dirname(__FILE__));
-
-
-/**
- * 返回bing每日壁纸
- */
-// if($imgurl){
-// header('Content-Type: image/JPEG');
-// @ob_end_clean();
-// @readfile($imgurl);
-// @flush(); @ob_flush();
-// exit();
-// }else{
-// exit('error');
-// }
-}
-?>
\ No newline at end of file