Skip to content

Instantly share code, notes, and snippets.

@gmcharlt
Last active Aug 29, 2015
Embed
What would you like to do?
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