aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2017-04-18 21:34:26 +1200
committerDavid Phillips <david@sighup.nz>2017-04-18 21:36:34 +1200
commite8247d272afbc57601dfa542caa2d7fcd60173ff (patch)
tree19a3878f0a6991e9fd9ba736086a8d84d4c9acfb
parentd95fa59541aaa4ea34f3188ef895e5fc5ed1f08a (diff)
downloadidalius-e8247d272afbc57601dfa542caa2d7fcd60173ff.tar.xz
Strip protocol from title's source URL
Helps avoid other poorly configured bots
-rwxr-xr-xidalius.pl3
1 files changed, 3 insertions, 0 deletions
diff --git a/idalius.pl b/idalius.pl
index 1a81917..c0782ff 100755
--- a/idalius.pl
+++ b/idalius.pl
@@ -96,6 +96,9 @@ sub url_get_title
my $shorturl = $url;
$shorturl = (substr $url, 0, $config{url_len}) . "…" if length ($url) > $config{url_len};
+ # remove http(s):// to avoid triggering other poorly configured bots
+ $shorturl =~ s,^https?://,,g;
+
my $composed_title = "$title ($shorturl)";
return $composed_title;
}