From aff65378ea1ae556dbccc9a2f97a97811c86c39d Mon Sep 17 00:00:00 2001 From: root Date: Mon, 30 Mar 2015 22:28:59 +0200 Subject: Anton: Whoops, moved back the embed* files. Will be used if someone wants to embed a more naked old school style of the streaming page (I'm not here to destroy TG's work. So saving this\!) --- web/stream.gathering.org/embed.pl | 72 ++++++++++++++++++++++++++++ web/stream.gathering.org/embed.tmpl | 39 +++++++++++++++ web/stream.gathering.org/new | 0 web/stream.gathering.org/pre-tg15/embed.pl | 72 ---------------------------- web/stream.gathering.org/pre-tg15/embed.tmpl | 39 --------------- 5 files changed, 111 insertions(+), 111 deletions(-) create mode 100644 web/stream.gathering.org/embed.pl create mode 100644 web/stream.gathering.org/embed.tmpl create mode 100644 web/stream.gathering.org/new delete mode 100644 web/stream.gathering.org/pre-tg15/embed.pl delete mode 100644 web/stream.gathering.org/pre-tg15/embed.tmpl (limited to 'web') diff --git a/web/stream.gathering.org/embed.pl b/web/stream.gathering.org/embed.pl new file mode 100644 index 0000000..e5f103c --- /dev/null +++ b/web/stream.gathering.org/embed.pl @@ -0,0 +1,72 @@ +#!/usr/bin/perl -I /srv/streamlib +use warnings; +use strict; +use CGI; +use Geo::IP; +use NetAddr::IP; +use Net::IP; +# apt-get install libnet-ip-perl libnetaddr-ip-perl +use HTML::Template; +use stream; +use stream::config; + +my $client = CGI->new; + +my $v4net = $stream::config::v4net; +my $v6net = $stream::config::v6net; +my $tg = $stream::config::tg; +my $tg_full = $stream::config::tg_full; +my %streams = %stream::config::streams; + +my $force_unicast = $client->param('forceunicast'); +my $no_header = $client->param('noheader'); + +my $location = undef; + +print $client->header(); + +my $clip = $client->remote_addr(); +my $template = HTML::Template->new(filename => 'index.tmpl'); +my $is_local = &is_ip_local($clip, $v4net, $v6net); + +my @streams = &html_local_test(); +$template->param(TG => $tg); +$template->param(TG_FULL => $tg_full); +$template->param(STREAMS => \@streams); +$template->param(NOHEADER => $no_header); +print $template->output(); + + +sub html_local_test() { + my @s = (); + foreach my $name (sort { $streams{$a}->{priority} <=> $streams{$b}->{priority} } keys %streams) { + my $title_link = "http://stream.tg$tg.gathering.org/stream.pl?delivery=%s&stream=${name}&interlaced=%s"; + my $multicast_link = $streams{$name}->{has_multicast} ? "multicast" : "unicast"; + $multicast_link = "unicast" if ($force_unicast == 1 || not $is_local); + + if ($streams{$name}->{external}) { + $title_link = $streams{$name}->{url}; + } else { + $title_link = sprintf($title_link, $multicast_link, $streams{$name}->{interlaced}); + } + my %hash = ( + 'title_link' => $title_link, + 'title' => $streams{$name}->{title}, + 'source' => $streams{$name}->{source}, + 'quality' => $streams{$name}->{quality}, + 'location' => $streams{$name}->{location}, + 'type' => $streams{$name}->{type}, + 'delivery' => $multicast_link, + ); + if ($multicast_link eq "multicast") { + $hash{'is_multicast'} .= 1; + my $unicast_link = $title_link; + $unicast_link=~s/multicast/unicast/g; + $hash{'unicast_link'} .= $unicast_link; + } + $hash{'description'} .= $streams{$name}->{description} if exists($streams{$name}->{description}); + push(@s, \%hash); + + } + return @s; +} diff --git a/web/stream.gathering.org/embed.tmpl b/web/stream.gathering.org/embed.tmpl new file mode 100644 index 0000000..ef8b692 --- /dev/null +++ b/web/stream.gathering.org/embed.tmpl @@ -0,0 +1,39 @@ + + + The Gathering <TMPL_VAR NAME=TG_FULL> Streams + + + + +
+ +

The Gathering Streams

+ +

 

+
+ + + + +
+ + +

Problems with the non game streams? The easiest way to get hold of us is on IRC (EFNet); one of ViD or doxid should be available if there's too much traffic on #tg to be heard.

+

.gathering.org">http://stream.tg.gathering.org

+ + + + + diff --git a/web/stream.gathering.org/new b/web/stream.gathering.org/new new file mode 100644 index 0000000..e69de29 diff --git a/web/stream.gathering.org/pre-tg15/embed.pl b/web/stream.gathering.org/pre-tg15/embed.pl deleted file mode 100644 index e5f103c..0000000 --- a/web/stream.gathering.org/pre-tg15/embed.pl +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/perl -I /srv/streamlib -use warnings; -use strict; -use CGI; -use Geo::IP; -use NetAddr::IP; -use Net::IP; -# apt-get install libnet-ip-perl libnetaddr-ip-perl -use HTML::Template; -use stream; -use stream::config; - -my $client = CGI->new; - -my $v4net = $stream::config::v4net; -my $v6net = $stream::config::v6net; -my $tg = $stream::config::tg; -my $tg_full = $stream::config::tg_full; -my %streams = %stream::config::streams; - -my $force_unicast = $client->param('forceunicast'); -my $no_header = $client->param('noheader'); - -my $location = undef; - -print $client->header(); - -my $clip = $client->remote_addr(); -my $template = HTML::Template->new(filename => 'index.tmpl'); -my $is_local = &is_ip_local($clip, $v4net, $v6net); - -my @streams = &html_local_test(); -$template->param(TG => $tg); -$template->param(TG_FULL => $tg_full); -$template->param(STREAMS => \@streams); -$template->param(NOHEADER => $no_header); -print $template->output(); - - -sub html_local_test() { - my @s = (); - foreach my $name (sort { $streams{$a}->{priority} <=> $streams{$b}->{priority} } keys %streams) { - my $title_link = "http://stream.tg$tg.gathering.org/stream.pl?delivery=%s&stream=${name}&interlaced=%s"; - my $multicast_link = $streams{$name}->{has_multicast} ? "multicast" : "unicast"; - $multicast_link = "unicast" if ($force_unicast == 1 || not $is_local); - - if ($streams{$name}->{external}) { - $title_link = $streams{$name}->{url}; - } else { - $title_link = sprintf($title_link, $multicast_link, $streams{$name}->{interlaced}); - } - my %hash = ( - 'title_link' => $title_link, - 'title' => $streams{$name}->{title}, - 'source' => $streams{$name}->{source}, - 'quality' => $streams{$name}->{quality}, - 'location' => $streams{$name}->{location}, - 'type' => $streams{$name}->{type}, - 'delivery' => $multicast_link, - ); - if ($multicast_link eq "multicast") { - $hash{'is_multicast'} .= 1; - my $unicast_link = $title_link; - $unicast_link=~s/multicast/unicast/g; - $hash{'unicast_link'} .= $unicast_link; - } - $hash{'description'} .= $streams{$name}->{description} if exists($streams{$name}->{description}); - push(@s, \%hash); - - } - return @s; -} diff --git a/web/stream.gathering.org/pre-tg15/embed.tmpl b/web/stream.gathering.org/pre-tg15/embed.tmpl deleted file mode 100644 index ef8b692..0000000 --- a/web/stream.gathering.org/pre-tg15/embed.tmpl +++ /dev/null @@ -1,39 +0,0 @@ - - - The Gathering <TMPL_VAR NAME=TG_FULL> Streams - - - - -
- -

The Gathering Streams

- -

 

-
- - - - -
- - -

Problems with the non game streams? The easiest way to get hold of us is on IRC (EFNet); one of ViD or doxid should be available if there's too much traffic on #tg to be heard.

-

.gathering.org">http://stream.tg.gathering.org

- - - - - -- cgit v1.2.3