<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/perl

use SOAP::Lite  on_action =&gt; sub {sprintf '%s/%s', @_}, ;

use Data::Dumper;
use XML::Simple;
my $meta_subset = &amp;get_frikanalen_meta_subset('Id'); # Use 'Id' or 'MetaDataVideoId' as key




###### Functions ##############

sub get_frikanalen_meta_subset {
 # Build metadata structure with id as key
 my $returndata;
 $soap = new SOAP::Lite
 -&gt; uri('http://localhost/CommunitySiteService')
 -&gt; proxy('http://communitysite1.frikanalen.tv/CommunitySiteFacade/CommunitySiteService.asmx');

 # Request list of all available videos with all avalable metadata for each video
 # constructing the expected xml code for 
 # http://communitysite1.frikanalen.tv/CommunitySiteFacade/CommunitySiteService.asmx?op=SearchVideos
 # 'Take' is how many records to grab. Just crank it higher than the number of available records,
 # and it will return all. 

 my $obj = $soap-&gt;SearchVideos(
  SOAP::Data-&gt;name('searcher' =&gt; {
   'PredefinedSearchType' =&gt; 'Default',
   'Take' =&gt; 10000,
   }
  )
 );
 unless ($obj-&gt;fault) {
  my $res = $obj-&gt;result;
  my $key = $_[0];
  my $nuug_video_prefix = 'http://www.nuug.no/pub/video/frikanalen/';
  # print Dumper($res);
  foreach my $video (@{$res-&gt;{'Data'}-&gt;{'Video'}}) {
    print "$video-&gt;{'Id'}\;$video-&gt;{'MetaDataVideoId'}\n";
   }
 } else {
   print join ', ',
   $result-&gt;faultcode,
   $result-&gt;faultstring;
 }
}
</pre></body></html>