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.
45 lines
773 B
Plaintext
45 lines
773 B
Plaintext
10 years ago
|
#!/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;
|
||
|
}
|