From 8d543b652a98b88e34da66ce6718ecc3f850282b Mon Sep 17 00:00:00 2001 From: Ian Young Date: Mon, 21 Apr 2014 09:06:16 +0000 Subject: [PATCH] Script to extract endpoint locations from eduGAIN metadata. --- build/extract_locs_edugain.pl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 build/extract_locs_edugain.pl diff --git a/build/extract_locs_edugain.pl b/build/extract_locs_edugain.pl new file mode 100755 index 00000000..daf44512 --- /dev/null +++ b/build/extract_locs_edugain.pl @@ -0,0 +1,20 @@ +#!/usr/bin/perl -w + +use Xalan; + +open(XML, xalanCall . " -IN ../mdx/int_edugain/imported.xml -XSL extract_locs.xsl|") || die "could not open input file"; +while () { + chop; + if (/^https:\/\/([^\/:]+(:\d+)?)(\/|$)/) { + my $location = $1; + $location .= ":443" unless defined $2; + $locations{$location} = 1; + } +} +close XML; + +foreach $loc (sort keys %locations) { + if ($loc =~ /([^:]+):(\d+)/) { + print "$1 $2\n"; + } +}