From 8dc5c28bff2b835e556207b010f3b9ad793a3347 Mon Sep 17 00:00:00 2001 From: Banana Date: Fri, 17 Feb 2012 11:14:36 +0100 Subject: [PATCH] tool to check the bookmarks --- lib/Insipid/Database.pm | 10 +++--- tools/linkcheck.pl | 79 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 5 deletions(-) create mode 100755 tools/linkcheck.pl diff --git a/lib/Insipid/Database.pm b/lib/Insipid/Database.pm index 28c239b..07ea254 100755 --- a/lib/Insipid/Database.pm +++ b/lib/Insipid/Database.pm @@ -81,8 +81,8 @@ sub dbupgrade { my $sth = $dbh->prepare($sql); $sth->execute; - my $sql = "UPDATE $tbl_options SET pos = ? where (name = ?)"; - my $sth = $dbh->prepare($sql); + $sql = "UPDATE $tbl_options SET pos = ? where (name = ?)"; + $sth = $dbh->prepare($sql); $sth->execute(3, 'feed_name'); $sth->execute(1, 'site_name'); $sth->execute(20, 'proxy_host'); @@ -94,12 +94,12 @@ sub dbupgrade { $sql = "INSERT INTO `$tbl_options` ( `name`, `value`, `description`, `pos`) VALUES ( 'feed_num', '10', 'How many feed entries per default (0 = all)', '4')"; - my $sth = $dbh->prepare($sql); + $sth = $dbh->prepare($sql); $sth->execute; - my $sql = "update $tbl_options set value = ? where (name = ?)"; - my $sth = $dbh->prepare($sql); + $sql = "update $tbl_options set value = ? where (name = ?)"; + $sth = $dbh->prepare($sql); $sth->execute($version, 'version'); return; diff --git a/tools/linkcheck.pl b/tools/linkcheck.pl new file mode 100755 index 0000000..32eaf4b --- /dev/null +++ b/tools/linkcheck.pl @@ -0,0 +1,79 @@ +#!/usr/bin/perl -w +# +# Copyright (C) 2012 jumpin.banana +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA +# + +use warnings; +use strict; +use Getopt::Long; +use DBI; + +BEGIN { + binmode STDOUT, ':encoding(UTF-8)'; + binmode STDERR, ':encoding(UTF-8)'; +} + +#push(@INC, "../lib"); +use lib "../lib"; +use Insipid::Config; +use Insipid::Database; +use Insipid::Bookmarks; + +$|=1; + +my $opt_help = 0; + +# if no arguments passed +&usage if @ARGV < 1; + +GetOptions( + "help|h" => \$opt_help, +) or die(&usage); + +&usage if $opt_help; + + +# +# main +# +my $query = "SELECT `url` "; + + + +# +# functions +# + +sub usage { + print <