neingeist
/
neinomaten
Archived
1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
neinomaten/media.ccc.de-link-meister

45 lines
773 B
Perl

#!/usr/bin/env perl
use v5.12;
use strict;
use warnings;
use Data::Dumper;
use LWP::Simple;
use JSON;
if(@ARGV != 1) {
say STDERR "usage: $0 conference_id";
exit 1;
}
my ($conference_id) = @ARGV;
sub get_conference {
my ($id) = @_;
my $json = get("http://api.media.ccc.de/public/conferences/$id");
return decode_json($json);
}
sub get_event {
my ($event) = @_;
my $json = get($event->{url});
return decode_json($json);
}
my $conference = get_conference($conference_id);
foreach my $ev (@{$conference->{events}}) {
my $event = get_event($ev);
my $url = $event->{frontend_link};
#$url =~ s!\.html!/oembed.html!g;
printf qq!=== %s ===\n!, $event->{title};
printf qq!<pre>* Vortragsvideo/Download bei [%s media.ccc.de]</pre>\n!, $url;
}