]> 91.132.146.200 Git - insipid.git/commitdiff
tool to check the bookmarks
authorBanana <banana@starscream.de>
Fri, 17 Feb 2012 10:22:54 +0000 (11:22 +0100)
committerBanana <banana@starscream.de>
Fri, 17 Feb 2012 10:22:54 +0000 (11:22 +0100)
lib/Insipid/Database.pm
tools/linkcheck.pl

index 07ea2543ee52418ac24f0ee21577229f8d5cf0e4..d300968431c78e6f7af8d1513fa0900bd6e8f382 100755 (executable)
@@ -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);
index 32eaf4be7f1280d13b6aa546d314efd055923392..bb42cd0f9bbc257c7df57d7610e92c33eff7f6d7 100755 (executable)
@@ -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;
 
 
 #