From 8eb96ccf0aafb916b96d1302ca3c153f75be5619 Mon Sep 17 00:00:00 2001 From: Örjan Persson Date: Mon, 13 Oct 2014 15:24:27 +0200 Subject: Actually work with HTTP links 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 | 2 +- scripts/spotify.pl | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/_data/scripts.yaml b/_data/scripts.yaml index cb150a1..3d0d73b 100644 --- a/_data/scripts.yaml +++ b/_data/scripts.yaml @@ -3509,7 +3509,7 @@ 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" diff --git a/scripts/spotify.pl b/scripts/spotify.pl index 92f82e4..607b44a 100644 --- a/scripts/spotify.pl +++ b/scripts/spotify.pl @@ -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; -- cgit v1.2.3 From 579995c9f012eba2207a4bf5bc53e0c1ec576007 Mon Sep 17 00:00:00 2001 From: Örjan Persson Date: Mon, 13 Oct 2014 16:00:28 +0200 Subject: Increment version in scripts too --- _data/scripts.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_data/scripts.yaml b/_data/scripts.yaml index 3d0d73b..175cf45 100644 --- a/_data/scripts.yaml +++ b/_data/scripts.yaml @@ -3513,7 +3513,7 @@ license: "GPLv2" name: "spotify" url: "https://github.com/op/irssi-spotify" - version: "1.0" + version: "1.1" - authors: "Marcus darix Rückert, tira, Stefan tommie Tomanek" contact: "darix@irssi.de, tira@isx.de, stefan@pico.ruhr.de" -- cgit v1.2.3