line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::LinkEmbedder::Link::Text::Metacpan; |
2
|
1
|
|
|
1
|
|
3021
|
use Mojo::Base 'Mojolicious::Plugin::LinkEmbedder::Link::Text::HTML'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
3
|
|
|
|
|
|
|
|
4
|
0
|
|
|
0
|
0
|
|
sub provider_name {'Metacpan'} |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub _learn_from_dom { |
7
|
0
|
|
|
0
|
|
|
my ($self, $dom) = @_; |
8
|
|
|
|
|
|
|
|
9
|
0
|
0
|
0
|
|
|
|
if (my $e = $dom->at('.author-pic > a > img') || $dom->at('link[rel="apple-touch-icon"]')) { |
10
|
0
|
|
0
|
|
|
|
my $url = $e->{src} || $e->{href}; |
11
|
0
|
0
|
|
|
|
|
$self->image($url =~ /^https?:/ ? $url : "//metacpan.org$url"); |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
|
|
|
$self->SUPER::_learn_from_dom($dom); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
1; |