From 2ee5e963f8ba11b86b59e8688a6de1abae371a66 Mon Sep 17 00:00:00 2001 From: zsgsdesign Date: Tue, 27 Jul 2021 00:05:36 +0800 Subject: [PATCH] fixed crawler file system bugs --- Crawler.php | 2 ++ babel.json | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Crawler.php b/Crawler.php index 0db09ad..d1e22dd 100644 --- a/Crawler.php +++ b/Crawler.php @@ -7,6 +7,7 @@ use KubAT\PhpSimple\HtmlDomParser; use Requests; use Exception; +use Storage; class Crawler extends CrawlerBase { @@ -115,6 +116,7 @@ private function _crawl($con, $info) $this->line("\n Exception : Problem's PDF not found.\n"); return; } + Storage::disk('NOJPublic')->makeDirectory("external/gym/"); file_put_contents(base_path("public/external/gym/UVaL$con.pdf"), $res->body); } catch (Exception $e) { $this->line("\n Exception : Failed while downloading PDF.\n"); diff --git a/babel.json b/babel.json index 603ae82..bf0beeb 100644 --- a/babel.json +++ b/babel.json @@ -6,7 +6,7 @@ "description": "UVaLive interface for NOJ", "license": "MIT", "repository":"https://github.com/NJUPTAAA/NOJ_Extension_UVaLive", - "version":"0.1.4", + "version":"0.2.0", "website":"https://icpcarchive.ecs.baylor.edu/", "provider":{ "judger":"Judger", @@ -15,6 +15,6 @@ "installer":"Installer" }, "require":{ - "NOJ":"0.3.2" + "NOJ":"^0.3.2" } }