[MetaCPAN] [PATCH] Handle OFTC IRC links

Shlomi Fish shlomif at shlomifish.org
Sat May 2 18:16:58 GMT 2015


Hi Marius,

On Sat,  2 May 2015 17:06:22 +0300
Marius Gavrilescu <marius at ieval.ro> wrote:

> OFTC bans Mibbit. Here's an untested trivial patch that uses the
> official OFTC webchat for OFTC IRC links.
> 

Thanks for sharing! One thing that is apparent is that there's quite a lot of
duplicate code between the clause you added and the Freenode one. Perhaps they
can be extracted into a common subroutine or closure.

Regards,

	Shlomi Fish

> ---
>  lib/MetaCPAN/Web/Role/ReleaseInfo.pm | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/lib/MetaCPAN/Web/Role/ReleaseInfo.pm
> b/lib/MetaCPAN/Web/Role/ReleaseInfo.pm index ecd09aa..f1a9dbb 100644
> --- a/lib/MetaCPAN/Web/Role/ReleaseInfo.pm
> +++ b/lib/MetaCPAN/Web/Role/ReleaseInfo.pm
> @@ -179,6 +179,10 @@ sub groom_irc {
>                  $irc_info->{web}
>                      =
> "https://webchat.freenode.net/?randomnick=1&prompt=1&channels=${channel}"; }
> +            elsif ( $host =~ /(?:^|\.)oftc\.net$/ ) {
> +                $irc_info->{web}
> +                    =
> "https://webchat.oftc.net/?randomnick=1&prompt=1&channels=${channel}";
> +            }
>              else {
>                  my $server = $host
>                      . (



-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
List of Text Processing Tools - http://shlom.in/text-proc

<rindolf>  If you repeat a scene 50k times, then the movie will have less
entropy and will compress better. ( irc://irc.freenode.org/#perlcafe )

Please reply to list if it's a mailing list post - http://shlom.in/reply .



More information about the MetaCPAN mailing list