Skip to content
Snippets Groups Projects
Commit df957d74 authored by Síle Ekaterin Liszka's avatar Síle Ekaterin Liszka
Browse files

Chessa::URI::Default: more oversights fixed

parent 02f69256
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,7 @@ sub head($self, $response, $uri, $on_info, $errors) {
$authority =~ s/^www\.(.*?)(?:\:.*)/$1/;
unless ($response->is_success) {
$on_info->($self->{msg}($authority, $response->status_line . ' received when attempting to fetch headers.')) if $errors;
$self->{log}("Unable to fetch URI '$uri' via HEAD: $response->status_line", $on_info, $errors);
return;
}
......@@ -119,8 +119,8 @@ sub redirect($self, $response, $uri) {
sub get($self, $response, $uri, $on_info, $redirect, $errors) {
my $authority = base_domain($uri);
if ($response->code != 200) {
$on_info->($self->{msg}($authority, 'Failed to retrieve document: ' . $response->status_line)) if $errors;
unless ($response->is_success) {
$self->{log}("Unable to fetch URI '$uri' via GET: $response->status_line", $on_info, $errors);
return;
}
......@@ -200,8 +200,6 @@ sub count_externals($self, $t, $source) {
}
sub ld_json($self, $t, $authority) {
$self->{log}('Checking for LD+JSON...');
for my $i ($t->findvalues('//script[@type="application/ld+json"]/text()')) {
my $json = JSON::MaybeXS->new->decode($i);
# FIXME: The Atlantic's devs can suck deez nuts.
......@@ -245,7 +243,6 @@ my %properties = (
);
sub tcard($self, $t, $authority) {
$self->{log}("Found a Twitter card.");
my %data = ();
for my $prop (keys %properties) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment