Skip to content

Instantly share code, notes, and snippets.

@gmcharlt
Last active August 29, 2015 14:08
Show Gist options
  • Save gmcharlt/ea7b015c61ee670e2e94 to your computer and use it in GitHub Desktop.
Save gmcharlt/ea7b015c61ee670e2e94 to your computer and use it in GitHub Desktop.
Emulate the "ping" and "receiver" service of the Adobe Digital Editions data collector
#!/usr/bin/perl
use strict;
use warnings;
use CGI;
use Data::Dumper;
my $input = CGI->new();
open my $log, '>>', '/tmp/datacollector-log';
print $log "$0 received request at " . localtime() . "\n";
print $log "--------------------------------------\n";
print $log "UA: " . $input->user_agent() . "\n";
print $log "Cookie: " . $input->cookie('s_vi') . "\n";
my $params = $input->Vars;
print $log Dumper($params);
print $log "\n\n";
print $input->header( -type => 'application/vnd.adobe.dc+xml', -charset => 'UTF-8' );
print 'UP';
close $log;
#!/usr/bin/perl
use strict;
use warnings;
use CGI;
use Data::Dumper;
my $input = CGI->new();
open my $log, '>>', '/tmp/datacollector-log';
print $log "$0 received request at " . localtime() . "\n";
print $log "--------------------------------------\n";
print $log "UA: " . $input->user_agent() . "\n";
print $log "Cookie: " . $input->cookie('s_vi') . "\n";
my $params = $input->Vars;
print $log Dumper($params);
print $log "\n\n";
print $input->header( -type => 'application/vnd.adobe.dc+xml', -charset => 'UTF-8' );
print 'OK';
close $log;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment