| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Net::Social::Mapper::Persona::Website; |
|
2
|
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
5442
|
use strict; |
|
|
4
|
|
|
|
|
9
|
|
|
|
4
|
|
|
|
|
185
|
|
|
4
|
4
|
|
|
4
|
|
23
|
use base qw(Net::Social::Mapper::Persona); |
|
|
4
|
|
|
|
|
11
|
|
|
|
4
|
|
|
|
|
2121
|
|
|
5
|
4
|
|
|
4
|
|
1822
|
use URI; |
|
|
4
|
|
|
|
|
11325
|
|
|
|
4
|
|
|
|
|
107
|
|
|
6
|
4
|
|
|
4
|
|
2527
|
use Feed::Find; |
|
|
4
|
|
|
|
|
123764
|
|
|
|
4
|
|
|
|
|
1366
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Net::Social::Mapper::Persona::Website - the persona for a website |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head2 SYNOPSIS |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
See C |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=cut |
|
17
|
|
|
|
|
|
|
sub _init { |
|
18
|
8
|
|
|
8
|
|
12
|
my $self = shift; |
|
19
|
8
|
|
|
|
|
35
|
$self->{service} = 'website'; |
|
20
|
8
|
|
|
|
|
20
|
$self->{name} = 'Website'; |
|
21
|
8
|
|
50
|
|
|
34
|
my $url = $self->_normalise_url($self->{user}) || return undef; |
|
22
|
8
|
|
|
|
|
29820
|
$self->{user} = $url->as_string; |
|
23
|
8
|
|
|
|
|
63
|
$self->{user} =~ s/\%([A-Fa-f0-9]{2})/pack('C', hex($1))/seg; |
|
|
0
|
|
|
|
|
0
|
|
|
24
|
8
|
|
|
|
|
25
|
$self->{homepage} = $self->{user}; |
|
25
|
8
|
|
|
|
|
69
|
$self->{domain} = $url->authority; |
|
26
|
8
|
|
|
|
|
260
|
return $self; |
|
27
|
|
|
|
|
|
|
} |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head2 feeds |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Get the feeds for this website. |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=cut |
|
34
|
|
|
|
|
|
|
sub feeds { |
|
35
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
|
36
|
0
|
0
|
|
|
|
0
|
$self->{feeds} = [ $self->mapper->_get_feeds($self->{homepage}) ] unless defined $self->{feeds}; |
|
37
|
0
|
|
|
|
|
0
|
return $self->SUPER::feeds(); |
|
38
|
|
|
|
|
|
|
} |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub _normalise_url { |
|
41
|
8
|
|
|
8
|
|
13
|
my $self = shift; |
|
42
|
8
|
|
50
|
|
|
34
|
my $url = shift || return; |
|
43
|
8
|
50
|
|
|
|
57
|
$url = "http://$url" unless $url =~ m![a-z]+:\/\/!i; |
|
44
|
8
|
|
|
|
|
58
|
$url = URI->new($url); |
|
45
|
|
|
|
|
|
|
} |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head2 persona_name |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
The short canonical name for this persona |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=cut |
|
52
|
0
|
|
|
0
|
1
|
|
sub persona_name { shift->_do('user', @_) } |
|
53
|
|
|
|
|
|
|
1; |
|
54
|
|
|
|
|
|
|
|