{"body":"#!/usr/bin/env raku\n\nuse WWW::Mechanize:from<Perl5>;\n\nmy $rss_types = <\n  application/rss+xml\n  application/xml\n  application/rdf+xml\n  text/xml\n>;\n\nsub MAIN($url = 'https://phoenixtrap.com') {\n    my $mech     = WWW::Mechanize.new;\n    my $response = $mech.get($url);\n    if ($response.content_type ~~ /html/) {\n        # find the feed in the HTML\n        my $alt_links = $mech.find_all_links(rel => 'alternate');\n\n        say $alt_links.first(*.attrs<type> eq 'application/rss+xml').url;\n        # output: https://phoenixtrap.com/feed/\n\n        try say $alt_links.first(*.attrs<type> ~~ $rss_types).url;\n        say $!;\n        # output: Cannot use Bool as Matcher with '.first'.  Did you mean to use $_ inside a block?\n        \n        say $alt_links.first( {$_.attrs<type> ~~ $rss_types} ).url;\n        # output: Nil\n    }\n}\n","name":"","extension":"txt","url":"https://www.irccloud.com/pastebin/lmQ7jGHc","modified":1628971064,"id":"lmQ7jGHc","size":829,"lines":29,"own_paste":false,"theme":"","date":1628971064}