diff --git a/app/Services/PageScrapper.php b/app/Services/PageScrapper.php new file mode 100644 index 0000000..bd86bad --- /dev/null +++ b/app/Services/PageScrapper.php @@ -0,0 +1,36 @@ +') + { + $this->url = $url; + $this->contentMarker = $contentMarker; + } + + public function getHTML() + { + $page = file_get_contents($this->url); + $strForPregMatch = "/" . "{$this->contentMarker}" . "(.*)<\/div>/isU"; + $arr = []; + $rez = preg_match_all($strForPregMatch, $page, $arr); + return $content = $arr[1][0].''; + + } + + public function normalizeURLFile($content) + { + $rez = preg_match_all('/href="(.*)"/isU',$content,$arr); + foreach ($arr[1] as $el) { + if (strpos($el, 'http') !== 0) { + $content = str_replace($el,'https://mkgtu.ru'.$el,$content); + } + } + return $content; + } +} diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index bd61e94..23893c0 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -44,11 +44,6 @@ - {{--