File: alternative-predicates.pl

package info (click to toggle)
libhttp-lrdd-perl 0.106-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 376 kB
  • sloc: perl: 3,663; makefile: 7; sh: 1
file content (20 lines) | stat: -rw-r--r-- 577 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use Data::Dumper;
use HTTP::LRDD;
use RDF::TrineX::Functions -shortcuts;

my $lrdd   = HTTP::LRDD->new;
my $lrdd_h = HTTP::LRDD->new(qw(hub));
my $lrdd_c = HTTP::LRDD->new(qw(copyright));

my $output = {};

foreach my $uri (qw(http://localhost/foo ftp://localhost/bar http://localhost/test/test.atom))
{
	$output->{$uri}->{'descriptors'} = [ $lrdd->discover($uri) ];
	$output->{$uri}->{'hubs'} =        [ $lrdd_h->discover($uri) ];
	$output->{$uri}->{'copyright'} =   [ $lrdd_c->discover($uri) ];
}

print Dumper( $output );

# XRD::Parser::hostmeta - check HTTPS before HTTP.