Who Needs Accessible Odeon

davorg on 2004-07-21T16:59:09

...when you have WWW::Odeon.

I was playing with something along these lines, but it looks like Iain beat me to it. Which is cool. He can deal with the lawyers instead of me :)

Here's a sample program.

#!/usr/bin/perl
                                                                                
use strict;
use warnings;
                                                                                
use WWW::Odeon;
                                                                                
my $cinema = shift || 'Streatham';
                                                                                
my $details = get_details($cinema);
                                                                                
foreach my $date (sort by_date keys %$details) {
  print "$date\n";
                                                                                
  foreach my $film (sort keys %{$details->{$date}}) {
    print "$film - ";
    print join ',', sort keys %{$details->{$date}{$film}};
    print "\n";
  }
  print "\n";
}
                                                                                
                                                                                
sub by_date {
  my @a = $a =~ m|(\d+)/(\d+)/(\d+)|;
  my @b = $b =~ m|(\d+)/(\d+)/(\d+)|;
                                                                                
  $a[2] <=> $b[2] || $a[1] <=> $b[1] || $a[0] <=> $b[0];
}


Scraping is not a problem

BooK on 2004-07-22T15:50:31

I think web scrapping the Odeon website is not a problem. The problem would be (or was) turning a webscrapping script into a CGI that's available to everyone (and that Odeon users might take for Odeon's original site).

So, as long as you can do whatever you want with the data you downloaded from the website, why not go for the web proxy option?

use HTTP::Proxy;
use HTTP::Proxy::BodyFilter::Odeon; # coding this module is left as an exercise for the reader ;-)

my $proxy = HTTP::Proxy->new;
$proxy->push_filter(
    response => HTTP::Proxy::BodyFilter::Odeon->new,
    host     => 'www.odeon.co.uk',
    # maybe a few more options here
);

$proxy->start;

And voilà, you can now surf as usual, infringing no copyright whatsoever and munging the web data for your own (and eventually your users) use. I don't think distributing an hypothetical HTTP::Proxy::BodyFilter::Odeon module would cause any trouble with Odeon (except for the name, maybe).

I think I've found the tagline for my YAPC::Europe talk:

HTTP::Proxy: surfing your version of the world-wide web.