-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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