commit 036e3addb2c21adc68e78a04e726a620c52f5a84
parent 8fa66770b18d6bcab3eb0e5531b07c2a530aa2f4
Author: xfnw <xfnw@thunix.net>
Date: Tue, 22 Dec 2020 10:13:45 -0500
re-crawl sites
Diffstat:
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/crawl.php b/crawl.php
@@ -38,6 +38,10 @@ foreach ($arg as $url) {
continue;
echo $title;
echo $document;
+
+ $stmt = $db->prepare('DELETE FROM indexed WHERE url = ?');
+ $stmt->execute([$url]);
+
$stmt = $db->prepare('INSERT INTO indexed (title, url, content) VALUES (?, ?, ?)');
$stmt->execute([$title, $url, $document]);
}
diff --git a/index.php b/index.php
@@ -64,8 +64,6 @@ if (isset($_GET['q']) && preg_replace('/\s+/', '', $_GET['q']) != '') {
$results = false;
foreach ($rows as $row) {
$results = true;
- if (substr($row['url'],-1,1)=='/')
- continue
?>
<div class='box'>