first commit

This commit is contained in:
张乾 2024-10-15 15:51:08 +08:00
parent b4cf855377
commit 58cbf6795b
2 changed files with 30 additions and 3 deletions

View File

@ -1,5 +1,3 @@
../
/assets/捐赠.md
/专栏/10x程序员工作法
/专栏/12步通关求职面试-完
/专栏/22 讲通关 Go 语言-完
@ -158,4 +156,4 @@
/专栏/领域驱动设计实践(完)
/专栏/高并发系统实战课
/专栏/高并发系统设计40问
/专栏/高楼的性能工程实战课
/专栏/高楼的性能工程实战课

29
crawl.php Normal file
View File

@ -0,0 +1,29 @@
<?php
// Define the URL
$url = "https://learn.lianglianglee.com/";
// Send the GET request
$response = file_get_contents($url);
if ($response === FALSE) {
echo "Failed to access the URL.";
} else {
// Use regex to find the href values across multiple lines (with the 's' modifier)
preg_match_all('/<li><a href="([^"]*)">([^<]*)<\/a><\/li>/', $response, $matches);
// Prepare the output for the readme file
$output = "";
if (!empty($matches[1])) {
foreach ($matches[1] as $href) {
$output .= $href.PHP_EOL;
}
} else {
$output = "No match found.\n";
}
// Write the results to readme.txt file
file_put_contents("README.md", $output);
echo "Results saved to readme.txt";
}
?>