From: Banana Date: Fri, 17 Feb 2012 10:22:54 +0000 (+0100) Subject: tool to check the bookmarks X-Git-Tag: 2.1-alpha-2019-0-29~87 X-Git-Url: http://91.132.146.200/gitweb/?a=commitdiff_plain;h=340952b5f7ad5fe56ca10076db5737a680085ce2;p=insipid.git tool to check the bookmarks --- 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; #