]> 91.132.146.200 Git - insipid.git/commitdiff
linkchecker...
authorBanana <banana@starscream.de>
Fri, 17 Feb 2012 15:41:53 +0000 (16:41 +0100)
committerBanana <banana@starscream.de>
Fri, 17 Feb 2012 15:41:53 +0000 (16:41 +0100)
lib/Insipid/Main.pm
lib/Insipid/Stats.pm
tools/linkcheck.pl

index e966daebb3d6c6f71eb2984bbdd3c60d1f3c5ecc..12e7663c728b7ba8c61e12e1fbff08b6bdb44079 100755 (executable)
@@ -1231,7 +1231,7 @@ sub update_bookmark {
                        set url = ?, md5 = ?, title = ?, description = ?,
                        access_level = ?,
                        linkcheck_status = 1,
-                       linkcheck_status = '',
+                       linkcheck_status = ''
                        where (id = ?)";
     my $sth = $dbh->prepare($sql);
     $sth->execute($url, md5_hex("$url"), $title, $description, $access_level,
index d151bf0eb38d0a43d686a545d63ab5adbd2e2bd0..2656f1b6fb5c065cf58dd387ec84a9fd3a8302c3 100644 (file)
@@ -73,7 +73,7 @@ sub groupByDomain {
                        my $uri = URI->new($row[1]);
 
                        if($row[2] eq 0) {
-                               print "<li><a href='$site_url/insipid.cgi?op=edit_bookmark&id=$row[0]'>".$row[1]."</a></li>";
+                               print "<li><a href='$site_url/insipid.cgi?op=edit_bookmark&id=$row[0]'>".$row[1]."</a> (<a href='$site_url/insipid.cgi?op=delete_bookmark&id=$row[0]'>delete</a>)</li>";
                        }
 
                        if($domainGroup{$uri->host}) {
index 8cb9614bb4c0903d7d1d07acacc9dac5f34c8452..c6c224c6cb1665011770a9ee7cb546b4a8edd04e 100755 (executable)
 # USA
 #
 
+
+#
+# check exiting bookmark entries if they are available
+# ssl entries will not be checked...
+# if they return a non 200 HTTP Status code they will be marked and visible
+# in the stats overview
+#
+
 use warnings;
 use strict;
 use Getopt::Long;
 use DBI;
+use Crypt::SSLeay;
 use LWP::UserAgent;
 
 BEGIN {
@@ -67,7 +76,11 @@ if($sth->rows ne 0) {
        $ua->timeout(5);
        $ua->show_progress(1);
        $ua->agent("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11");
-       $ua->proxy(['http'], $opt_proxy) if $opt_proxy;
+
+       $ua->proxy([ 'http', 'https' ], $opt_proxy) if $opt_proxy;
+
+       $ua->ssl_opts('verify_hostname' => 0);
+       $ua->protocols_allowed(undef); #  all are allowed
 
        $query = "UPDATE `$tbl_bookmarks`
                                SET `linkcheck_status` = ?,
@@ -78,7 +91,11 @@ if($sth->rows ne 0) {
        while (my $hr = $sth->fetchrow_hashref) {
                print $hr->{url}." ";
 
-               my $response = $ua->head($hr->{url});
+               # ssl not working correctly so avoid those bookmarks
+               next if $hr->{url} =~ m/https:/g;
+
+               #my $response = $ua->head($hr->{url});
+               my $response = $ua->get($hr->{url});
                my $status = 0;
 
                if ($response->is_success) {