| 1 | package URI::Title::PDF; | ||||||||||||||||||||||||||||
| 2 | 3 | $URI::Title::PDF::VERSION = '1.903'; | |||||||||||||||||||||||||||
| 3 | 3 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | sub types {( | ||||||||||||||||||||||||||||
| 7 | 2 | ▶ | 'application/pdf', | ||||||||||||||||||||||||||
|
Subroutine
types: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 8 | )} | ||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | sub title { | ||||||||||||||||||||||||||||
| 11 | 0 | ▶ | my ($class, $url, $data, $type) = @_; | ||||||||||||||||||||||||||
|
Subroutine
title: not called CC=10 SCAR=47.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 0 | my %fields = (); | |||||||||||||||||||||||||||
| 14 | 0 | ▶ | my $content = URI::Title::_get_end($url) or return; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 15 | 0 | foreach my $i (qw(Producer Creator CreationDate Author Title Subject)) { | |||||||||||||||||||||||||||
| 16 | 0 | my @parts = $content =~ m#/$i \((.*?)\)#mgs; | |||||||||||||||||||||||||||
| 17 | 0 | $fields{$i} = $parts[-1]; # grab the last one, hopefully right | |||||||||||||||||||||||||||
| 18 | } | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 0 | my $title = ""; | |||||||||||||||||||||||||||
| 21 | 0 | my @parts = (); | |||||||||||||||||||||||||||
| 22 | 0 | ▶ | if ($fields{Title}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 23 | 0 | push @parts, "$fields{Title}"; | |||||||||||||||||||||||||||
| 24 | 0 | ▶ | if ($fields{Author}) { push @parts, "by $fields{Author}"; } | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 25 | 0 | ▶ | if ($fields{Subject}) { push @parts, "($fields{Subject})"; } | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||
| 27 | 0 | ▶ | if ($fields{Creator} and $fields{Creator} ne 'Not Available') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$fields{"Creator"} and $fields{"Creator"} ne "Not Available"
MC/DC0%0/2
$fields{"Creator"} and $fields{"Creator"} ne "Not Available"
$fields{"Creator"}
$fields{"Creator"} ne "Not Available"
Truth table0%0/3
A and B
A= $fields{"Creator"}B= $fields{"Creator"} ne "Not Available"
| |||||||||||||||||||||||||||||
| 28 | 0 | push @parts, "creator: $fields{Creator}"; | |||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | 0 | ▶ | if ($fields{Producer} and $fields{Producer} ne 'Not Available') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$fields{"Producer"} and $fields{"Producer"} ne "Not Available"
MC/DC0%0/2
$fields{"Producer"} and $fields{"Producer"} ne "Not Available"
$fields{"Producer"}
$fields{"Producer"} ne "Not Available"
Truth table0%0/3
A and B
A= $fields{"Producer"}B= $fields{"Producer"} ne "Not Available"
| |||||||||||||||||||||||||||||
| 31 | 0 | push @parts, "produced: $fields{Producer}"; | |||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | 0 | $title = join(' ', @parts); | |||||||||||||||||||||||||||
| 34 | 0 | return $title; | |||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 3 | 1; | |||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | __END__ | ||||||||||||||||||||||||||||