From 036e3addb2c21adc68e78a04e726a620c52f5a84 Mon Sep 17 00:00:00 2001 From: xfnw Date: Tue, 22 Dec 2020 10:13:45 -0500 Subject: [PATCH] re-crawl sites --- crawl.php | 4 ++++ index.php | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crawl.php b/crawl.php index 72bdb04..9f611e4 100644 --- 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 index 6227932..f213522 100644 --- 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 ?>