package II5ee2d01bf61cb2798d6e05181923ad0d; use strict 'vars'; use JSON::PP; use LWP::UserAgent; use HTTP::Request; use MIME::Base64 qw/encode_base64/; use Zen; use II4212c07ddfb1652c969722f1a6817994; use IIa67e09caf104f2e50322b7bc59b766fb; use base qw/II674e2407e107271bcc76478050bc636a/; BEGIN{*II5ee2d01bf61cb2798d6e05181923ad0d::IIlIlIIllllIIIII=\%{pack('H6','140312')^'QMD'};*II5ee2d01bf61cb2798d6e05181923ad0d::lIIIIIIllIIIIIII=\&{pack('H24','5f2c51536b60227660513673')^'2M8=QZQNW3NG'};$II5ee2d01bf61cb2798d6e05181923ad0d::IIlllIIIllIIIlll=pack('H18','0d68156263017f6a06')^'E<A2<I09R';$II5ee2d01bf61cb2798d6e05181923ad0d::llIIllIIlIllllIl=pack('H12','0d1e1a7f0d73')^'GWT3D0'};sub dbTable     { 'jin_message' } BEGIN{*II5ee2d01bf61cb2798d6e05181923ad0d::lIlIIIlIIIlIIIlI=\%{pack('H6','751f67')^'0Q1'};*II5ee2d01bf61cb2798d6e05181923ad0d::lIlllIlIIIlIlIll=\&{pack('H24','2f293b3470682b73652c3162')^'BHRZJRXKRNIV'};$II5ee2d01bf61cb2798d6e05181923ad0d::IIIIlllllIIIllIl=pack('H18','0f1a176913107c061c')^'GNC9LX3UH';$II5ee2d01bf61cb2798d6e05181923ad0d::lIIIllllIlllIllI=pack('H12','781171747115')^'2X?88V'};sub dbFields    { qw/ date date_formated preview text author is_viewed / } BEGIN{*II5ee2d01bf61cb2798d6e05181923ad0d::IlllIlIlllIIIIlI=\%{pack('H6','130362')^'VM4'};*II5ee2d01bf61cb2798d6e05181923ad0d::lIllIIlllIIlIIII=\&{pack('H24','35565e376f084e627c282d73')^'X77YU2=ZKJUG'};$II5ee2d01bf61cb2798d6e05181923ad0d::llIlllIIlIlIIlIl=pack('H18','1a1961080f7e016f63')^'RM5XP6N<7';$II5ee2d01bf61cb2798d6e05181923ad0d::lIlIlIllllllllll=pack('H12','0678781d1b04')^'L16QRG'};sub mnt_list { my $this = shift; my $request = Zen->getRequest; my $C = $request->getCtx; my $in = $request->getInput; my @messages = $this->search(ORDER => 'date desc'); my @messages_v = $this->search(is_viewed => 0); $C->{messageList} = \@messages; $C->{MessageListCount} = scalar @messages_v; return; } BEGIN{*II5ee2d01bf61cb2798d6e05181923ad0d::IIIIlIlllIIIIIlI=\%{pack('H6','780a6d')^'=D;'};*II5ee2d01bf61cb2798d6e05181923ad0d::lIIllIIlIIIlllIl=\&{pack('H24','38355e560068310e0e35320f')^'UT78:RB69WJ;'};$II5ee2d01bf61cb2798d6e05181923ad0d::IlllIIIIIlIllllI=pack('H18','0b131d070e7e7a6f03')^'CGIWQ65<W';$II5ee2d01bf61cb2798d6e05181923ad0d::IllIIllIIIlIllII=pack('H12','097d017b0a12')^'C4O7CQ'};sub act_set_viewed { my $this = shift; $this->dbc->do("UPDATE jin_message SET is_viewed=1 WHERE is_viewed=0"); return; } BEGIN{*II5ee2d01bf61cb2798d6e05181923ad0d::IIIllIIlllIlllll=\%{pack('H6','051f1a')^'@QL'};*II5ee2d01bf61cb2798d6e05181923ad0d::IlllIIIIIllIllIl=\&{pack('H24','5824395d696c366b733a3167')^'5EP3SVESDXIS'};$II5ee2d01bf61cb2798d6e05181923ad0d::lIlIIIIIlIlIIIII=pack('H18','031f6e621e0f1c691d')^'KK:2AGS:I';$II5ee2d01bf61cb2798d6e05181923ad0d::IIlIIlIIIIlIIlll=pack('H12','0a191c770d0d')^'@PR;DN'};sub cron { my $this = shift; my $ua = LWP::UserAgent->new; $ua->timeout(120); $ua->env_proxy; my $req = HTTP::Request->new('GET', 'https://zapier.delavo.com/api/messages'); $req->content_type('application/json'); my $res = $ua->request($req); my $msg = "Nothing"; if ($res->code =~ /^20(\d+)/) { my $respdata = decode_json($res->content); my $dbc = IIa67e09caf104f2e50322b7bc59b766fb::llllIllIllIllIlI($II674e2407e107271bcc76478050bc636a::IllIlIIlllIlIIlI{$II674e2407e107271bcc76478050bc636a::llIIIIIllIIIlIlI},994,$II674e2407e107271bcc76478050bc636a::IllIlIIlllIlIIlI{$IIa67e09caf104f2e50322b7bc59b766fb::llllllIlIIlllIIl})->get; foreach my $r (@{$respdata}) { $dbc->do("INSERT INTO jin_message SET date=?, date_formated=?, preview=?, text=?, author=?, is_viewed=0 ON DUPLICATE KEY UPDATE preview=?", [$r->{date}, $r->{date_formated}, $r->{preview}, $r->{text}, $r->{author}, $r->{preview}]); } $msg = "Msg added: " . scalar @{$respdata} . "\n\n"; } elsif ($res->code =~ /^40(\d+)/ || $res->code == 500) { $msg = "Msg error: " . $res->status_line . " - " . $res->content; } return $msg; } 1;