]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
Actually work with HTTP links
authorÖrjan Persson <redacted>
Mon, 13 Oct 2014 13:24:27 +0000 (15:24 +0200)
committerÖrjan Persson <redacted>
Mon, 13 Oct 2014 13:24:27 +0000 (15:24 +0200)
URL paths starts with a leading slash. These are now stripped away to
work the same way as URI's are handled.

_data/scripts.yaml
scripts/spotify.pl

index cb150a1e9d0aa9d0ae77bcc885009d5ade184160..3d0d73bfbd3d315735d629fd2a7781a07ca9568a 100644 (file)
   contact: "o@42mm.org"
   description: "Lookup spotify uris"
   filename: "spotify.pl"
-  modified: "2014-07-28 18:26:57"
+  modified: "2014-10-13 15:22:00"
   license: "GPLv2"
   name: "spotify"
   url: "https://github.com/op/irssi-spotify"
index 92f82e42833f46afeb3cb7d2692a106b82c26e7f..607b44a285e801394c3b62f51b4b1b906a6a378b 100644 (file)
@@ -18,7 +18,7 @@
 
 use strict;
 use vars qw($VERSION %IRSSI);
-$VERSION = '1.0';
+$VERSION = '1.1';
 %IRSSI = (
        authors     => 'Örjan Persson',
        contact     => 'o@42mm.org',
@@ -413,10 +413,15 @@ sub spotify_lookup {
        my $writer = shift;
        my ($uri, $manual) = @{$_[0]};
 
+       # Remove any leading whitespace and trailing whitespace and dots
        $uri =~ s/^\s+//g;
        $uri =~ s/[\s\.]+$//g;
-       my $u = URI->new($uri);
-       my @parts = split /[\/:]/, URI->new($uri)->path;
+
+       # Unify how we look at the path, removing leading / to match how path looks
+       # for URIs with : where the path never starts with a :.
+       my $u = URI->new($uri)->path;
+       $u =~ s/^\///;
+       my @parts = split /[\/:]/, $u;
 
        my $path;
        my $auth;
git clone https://git.99rst.org/PROJECT