Diff -- /var/www/vhosts/3dshawn.com/abforge.3dshawn.com/h.cgi
Diff

/var/www/vhosts/3dshawn.com/abforge.3dshawn.com/h.cgi

added on local at 2026-07-01 16:01:22

Added
+39
lines
Removed
-0
lines
Context
0
unchanged
Blobs
from
to 5382fbabc7ad
Restore this content →
Unified diff
Naive LCS-based line diff. Additions in emerald, deletions in rose. Both sides decompressed live from BLOB_STORE.
1#!/usr/bin/perl
2use strict;
3use warnings;
4use lib '/var/www/vhosts/3dshawn.com/abforge.3dshawn.com';
5
6my $raw = '';
7if (($ENV{REQUEST_METHOD} || '') eq 'POST') {
8 my $len = int($ENV{CONTENT_LENGTH} || 0);
9 if ($len > 0 && $len < 1_048_576) {
10 read STDIN, $raw, $len;
11 }
12}
13
14use MODS::DBConnect;
15use MODS::ABForge::Tracking;
16use JSON::PP;
17
18my $db = MODS::DBConnect->new;
19my $trk = MODS::ABForge::Tracking->new;
20my $DB = 'abforge3dshawn';
21
22print "Access-Control-Allow-Origin: *\n";
23print "Access-Control-Allow-Methods: POST, OPTIONS\n";
24print "Access-Control-Allow-Headers: Content-Type\n";
25print "Cache-Control: no-store\n";
26
27if (($ENV{REQUEST_METHOD} || '') eq 'OPTIONS') {
28 print "Content-Type: text/plain\n\nok"; exit;
29}
30print "Content-Type: application/json\n\n";
31
32my $body = eval { JSON::PP::decode_json($raw) } || {};
33$body->{t} = 'hm';
34
35my $dbh = $db->db_connect();
36unless ($dbh) { print '{"ok":0}'; exit; }
37eval { $trk->ingest($dbh, $DB, $body) };
38$db->db_disconnect($dbh);
39print '{"ok":1}';
Keyboard: j next diff k previous diff g top G bottom r restore c compile-check ? help