Skip to content

Instantly share code, notes, and snippets.

@andrewalker
Created June 14, 2012 19:12

Revisions

  1. andrewalker revised this gist Jun 14, 2012. 1 changed file with 2 additions and 5 deletions.
    7 changes: 2 additions & 5 deletions watch.pl
    Original file line number Diff line number Diff line change
    @@ -5,10 +5,7 @@
    # usage:
    # mplayer $(perl watch.pl http://ics.webcast.uwex.edu/mediasite/Viewer/?peid=ceecb7a37e3f4dbbb13e7f5cc9f513291d)

    my $url = shift;
    $url =~ /\?peid=(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/;

    my @parts = ($1,$2,$3,$4,$5);

    my @parts = (shift =~ /\?peid=(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/);
    local $" = '-';

    print "http://video.ics.uwex.edu/@parts";
  2. andrewalker revised this gist Jun 14, 2012. 1 changed file with 2 additions and 9 deletions.
    11 changes: 2 additions & 9 deletions watch.pl
    Original file line number Diff line number Diff line change
    @@ -6,16 +6,9 @@
    # mplayer $(perl watch.pl http://ics.webcast.uwex.edu/mediasite/Viewer/?peid=ceecb7a37e3f4dbbb13e7f5cc9f513291d)

    my $url = shift;
    $url =~ /\?peid=(.*)$/;
    my $peid = substr($1, 0, -2);
    $url =~ /\?peid=(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/;

    my @parts = (
    substr($peid, 0, 8),
    substr($peid, 8, 4),
    substr($peid, 12, 4),
    substr($peid, 16, 4),
    substr($peid, 20)
    );
    my @parts = ($1,$2,$3,$4,$5);

    local $" = '-';
    print "http://video.ics.uwex.edu/@parts";
  3. andrewalker created this gist Jun 14, 2012.
    21 changes: 21 additions & 0 deletions watch.pl
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    #!/usr/bin/env perl
    use warnings;
    use strict;

    # usage:
    # mplayer $(perl watch.pl http://ics.webcast.uwex.edu/mediasite/Viewer/?peid=ceecb7a37e3f4dbbb13e7f5cc9f513291d)

    my $url = shift;
    $url =~ /\?peid=(.*)$/;
    my $peid = substr($1, 0, -2);

    my @parts = (
    substr($peid, 0, 8),
    substr($peid, 8, 4),
    substr($peid, 12, 4),
    substr($peid, 16, 4),
    substr($peid, 20)
    );

    local $" = '-';
    print "http://video.ics.uwex.edu/@parts";