From 340952b5f7ad5fe56ca10076db5737a680085ce2 Mon Sep 17 00:00:00 2001 From: Banana Date: Fri, 17 Feb 2012 11:22:54 +0100 Subject: [PATCH] tool to check the bookmarks --- lib/Insipid/Database.pm | 5 +++++ tools/linkcheck.pl | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/Insipid/Database.pm b/lib/Insipid/Database.pm index 07ea254..d300968 100755 --- a/lib/Insipid/Database.pm +++ b/lib/Insipid/Database.pm @@ -97,6 +97,11 @@ sub dbupgrade { $sth = $dbh->prepare($sql); $sth->execute; + $sql = "ALTER TABLE `$tbl_bookmarks` + ADD COLUMN `linkcheck_status` int(1) NOT NULL AFTER `access_level`, + ADD COLUMN `linkcheck_date` int(10) NOT NULL AFTER `linkcheck_status`;"; + $sth = $dbh->prepare($sql); + $sth->execute; $sql = "update $tbl_options set value = ? where (name = ?)"; $sth = $dbh->prepare($sql); diff --git a/tools/linkcheck.pl b/tools/linkcheck.pl index 32eaf4b..bb42cd0 100755 --- a/tools/linkcheck.pl +++ b/tools/linkcheck.pl @@ -37,12 +37,14 @@ use Insipid::Bookmarks; $|=1; my $opt_help = 0; +my $opt_link = "all"; # if no arguments passed &usage if @ARGV < 1; GetOptions( "help|h" => \$opt_help, + "link|l" => \$opt_link ) or die(&usage); &usage if $opt_help; @@ -51,8 +53,11 @@ GetOptions( # # main # -my $query = "SELECT `url` "; +my $query = "SELECT `url` FROM `$tbl_bookmarks`"; +$query .= " WHERE `linkcheck_status` = " if($opt_link == 1); +$query .= " WHERE `linkcheck_status` = " if($opt_link == 0); +print $query; # -- 2.39.5