Use -dump-token-types (-dtt) to get a list of token type codes
2: 
2: 
3: 
3: 
4: #use strict;
4: ############
5: #use utf8;
5: ##########
6: #use warnings;
6: ##############
7: #use feature 'say';
7: ###################
8: #use open qw/ :std OUT :encoding(UTF-8) /;
8: ##########################################
9: #use warnings;
9: ##############
10: #use BerkeleyDB;
10: ################
11: use DB_File;
11: kkkbwwwwwww;
12: use Date::Parse;
12: kkkbwwwwwwwwwww;
13: use Encode qw(decode encode);
13: kkkbwwwwwwbqqqqqqqqqqqqqqqqq;
14: #use DateTime;
14: ##############
15: use Fcntl ':flock';
15: kkkbwwwwwbQQQQQQQQ;
16: #use v5.10;
16: ###########
17: use Text::Wrap;
17: kkkbwwwwwwwwww;
18: use XML::FeedPP ();
18: kkkbwwwwwwwwwwwb{};
19: #use FTN::Packet qw(&write_ftn_packet);
19: #######################################
20: use FTN::Packet;
20: kkkbwwwwwwwwwww;
21: use FTN::Log qw(&logging);
21: kkkbwwwwwwwwbqqqqqqqqqqqq;
22: 
22: 
23: 
23: 
24: my $res1 = 'https://www.pravda.com.ua/rus/rss/';
24: kkbiiiiib=bQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ;
25: #my $res2 = 'https://www.obozrevatel.com/out/rss/lastnews.xml';
25: ###############################################################
26: my $res3 = 'https://focus.ua/modules/rss.php';
26: kkbiiiiib=bQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ;
27: my $res4 = 'https://theins.ru/feed';
27: kkbiiiiib=bQQQQQQQQQQQQQQQQQQQQQQQQ;
28: my $res5 = 'https://www.pravda.com.ua/eng/rss-info/';
28: kkbiiiiib=bQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ;
29: my $res6 = 'https://gazeta.ua/ru/rss';
29: kkbiiiiib=bQQQQQQQQQQQQQQQQQQQQQQQQQQ;
30: my $feed = XML::FeedPP->new( $res3 );
30: kkbiiiiib=bwwwwwwwwwwwwwwww{biiiiib};
31: 
31: 
32: my %database;
32: kkbiiiiiiiii;
33: my %database2;
33: kkbiiiiiiiiii;
34: my %packet_info;
34: kkbiiiiiiiiiiii;
35: my @messages;
35: kkbiiiiiiiii;
36: 
36: 
37: my $db = tie %database, 'DB_File', "/data/ftp/pub/CODE/FIDO/rssbot/PRAVDADB.dat", O_CREAT | O_RDWR, 0666 or die "Cannot initial: $! \n ";
37: kkbiiib=bkkkbiiiiiiiii,bQQQQQQQQQ,bQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ,bwwwwwwwb|bwwwwww,bnnnnbkkbkkkbQQQQQQQQQQQQQQQQQQQQQQQQ;
38: my $fd = $db->fd();
38: kkbiiib=biiiiiii{};
39: my $db2 = tie %database2, 'DB_File', "/data/ftp/pub/CODE/FIDO/rssbot/PRAVDADB2.dat", O_CREAT | O_RDWR, 0666 or die "Cannot initial: $! \n ";
39: kkbiiiib=bkkkbiiiiiiiiii,bQQQQQQQQQ,bQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ,bwwwwwwwb|bwwwwww,bnnnnbkkbkkkbQQQQQQQQQQQQQQQQQQQQQQQQ;
40: my $fd2 = $db2->fd();
40: kkbiiiib=biiiiiiii{};
41: open DATAFILE, "+<&=$fd" or "Impossible safe open db: $! \n";
41: kkkkbwwwwwwww,bQQQQQQQQQbkkbQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ;
42: flock(DATAFILE, LOCK_SH) or die "Cannot block: $! \n";
42: kkkkk{wwwwwwww,bwwwwwww}bkkbkkkbQQQQQQQQQQQQQQQQQQQQQ;
43: open DATAFILE2, "+<&=$fd2" or "Impossible safe open db: $! \n";
43: kkkkbwwwwwwwww,bQQQQQQQQQQbkkbQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ;
44: flock(DATAFILE2, LOCK_SH) or die "Cannot block: $! \n";
44: kkkkk{wwwwwwwww,bwwwwwww}bkkbkkkbQQQQQQQQQQQQQQQQQQQQQ;
45: foreach my $item ( $feed->get_item() ) {
45: kkkkkkkbkkbiiiiib{biiiiiiiiiiiiiii{}b}b{
46: #
46: #
47: my $title1 = $item->title();
47: kkbiiiiiiib=biiiiiiiiiiii{};
48: my $desc1 = $item->description();
48: kkbiiiiiib=biiiiiiiiiiiiiiiiii{};
49: my $link1 = $item->link();
49: kkbiiiiiib=biiiiiiiiiii{};
50: my $pbdt1 = $item->pubDate();
50: kkbiiiiiib=biiiiiiiiiiiiii{};
51: # Decode to CP866
51: #################
52: #    $title1 = encode("cp866", $title1);
52: ########################################
53: #    $desc1 = encode("cp866", $desc1);
53: ######################################
54: my $unixtime = str2time($pbdt1);
54: kkbiiiiiiiiib=bUUUUUUUU{iiiiii};
55: if(exists($database2{$unixtime}))
55: kk{kkkkkk{iiiiiiiiiiLiiiiiiiiiR}}
56: {
56: {
57: # nothing    
57: #############
58: }
58: }
59: else
59: kkkk
60: {
60: {
61: chomp $title1;
61: kkkkkbiiiiiii;
62: chomp $desc1;
62: kkkkkbiiiiii;
63: chomp $link1;
63: kkkkkbiiiiii;
64: chomp $pbdt1;
64: kkkkkbiiiiii;
65: #  next if($title1 =~ s/^\s*$/);
65: ################################
66: #  print "111\n";    
66: #####################
67: #  next if($desc1 =~ s/^\s*$/);
67: ###############################
68: #  print "222\n";	
68: ##################
69: #  next if($link11 =~ s/^\s*$/);
69: ################################
70: #  print "333\n";
70: #################
71: #  next if($pbdt1 =~ s/^\s*$/);
71: ###############################
72: #  print "444\n";
72: #################
73: #   $title1=~ s{ \s* \z}{}xms;
73: ##############################
74: #   $desc1=~ s{ \s* \z}{}xms;
74: #############################
75: #   $link1=~ s{ \s* \z}{}xms;
75: #############################
76: #   $pbdt1=~ s{ \s* \z}{}xms;
76: #############################
77: ##   $title1=~s/\r?\n\z//;
77: ##########################
78: #   $desc1=~s/\r?\n\z//;
78: ########################
79: #   $link1=~s/\r?\n\z//;
79: ########################
80: #   $pbdt1=~s/\r?\n\z//;
80: ########################
81: #   $title1=~s/\r//g;
81: #####################
82: #   $desc1=~s/\r//g;
82: ####################
83: $title1=~s/\s+/ /g;
83: iiiiiii=~QQQQQQQQQ;
84: $desc1=~s/\s+/ /g;
84: iiiiii=~QQQQQQQQQ;
85: $title1=~s/<(?:[^>'"]*|(['"]).*?\1)*>//gs;
85: iiiiiii=~QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ;
86: $desc1=~s/<(?:[^>'"]*|(['"]).*?\1)*>//gs;
86: iiiiii=~QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ;
87: my $datadb = $title1."||".$desc1."||".$link1."||".$pbdt1;
87: kkbiiiiiiib=biiiiiii.QQQQ.iiiiii.QQQQ.iiiiii.QQQQ.iiiiii;
88: $database{$unixtime}=$datadb;
88: iiiiiiiiiLiiiiiiiiiR=iiiiiii;
89: }
89: }
90: }
90: }
91: undef $db;
91: kkkkkbiii;
92: untie %database;
92: kkkkkbiiiiiiiii;
93: close DATAFILE;
93: kkkkkbwwwwwwww;
94: 
94: 
95: undef $db2;
95: kkkkkbiiii;
96: untie %database2;
96: kkkkkbiiiiiiiiii;
97: close DATAFILE2;
97: kkkkkbwwwwwwwww;
98: 
98: 
99: undef %database;
99: kkkkkbiiiiiiiii;
100: undef %database2;
100: kkkkkbiiiiiiiiii;
101: undef $fd;
101: kkkkkbiii;
102: undef $fd2;
102: kkkkkbiiii;
103: my $idx;
103: kkbiiii;
104: undef my %onedb;
104: kkkkkbkkbiiiiii;
105: #undef my $key;
105: ###############
106: undef my $title1;
106: kkkkkbkkbiiiiiii;
107: undef my $desc1;
107: kkkkkbkkbiiiiii;
108: undef my $link1;
108: kkkkkbkkbiiiiii;
109: undef my $pbdt1;
109: kkkkkbkkbiiiiii;
110: 
110: 
111: # all news records
111: ##################
112: 
112: 
113: my %database;
113: kkbiiiiiiiii;
114: # already send
114: ##############
115: my %database2;
115: kkbiiiiiiiiii;
116: my $db = tie %database, 'DB_File', "/data/ftp/pub/CODE/FIDO/rssbot/PRAVDADB.dat", O_CREAT | O_RDWR, 0666 or die "Cannot initial: $! \n ";
116: kkbiiib=bkkkbiiiiiiiii,bQQQQQQQQQ,bQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ,bwwwwwwwb|bwwwwww,bnnnnbkkbkkkbQQQQQQQQQQQQQQQQQQQQQQQQ;
117: my $db2 = tie %database2, 'DB_File', "/data/ftp/pub/CODE/FIDO/rssbot/PRAVDADB2.dat", O_CREAT | O_RDWR, 0666 or die "Cannot initial: $! \n ";
117: kkbiiiib=bkkkbiiiiiiiiii,bQQQQQQQQQ,bQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ,bwwwwwwwb|bwwwwww,bnnnnbkkbkkkbQQQQQQQQQQQQQQQQQQQQQQQQ;
118: 
118: 
119: my $fd = $db->fd();
119: kkbiiib=biiiiiii{};
120: my $fd2 = $db2->fd();
120: kkbiiiib=biiiiiiii{};
121: 
121: 
122: open DATAFILE, "+<&=$fd" or "Impossible safe open db: $! \n";
122: kkkkbwwwwwwww,bQQQQQQQQQbkkbQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ;
123: #flock(DATAFILE, LOCK_SH) or die "Cannot block: $! \n";
123: #######################################################
124: open DATAFILE2, "+<&=$fd2" or "Impossible safe open db: $! \n";
124: kkkkbwwwwwwwww,bQQQQQQQQQQbkkbQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ;
125: #flock(DATAFILE2, LOCK_SH) or die "Cannot block: $! \n";
125: ########################################################
126: 
126: 
127: $idx=0;
127: iiii=n;
128: my %onedb;
128: kkbiiiiii;
129: 
129: 
130: foreach my $key (sort keys %database)
130: kkkkkkkbkkbiiiib{kkkkbkkkkbiiiiiiiii}
131: {
131: {
132: #print "$key \n", ("="x(length($key)+1)),"\n\n";
132: ################################################
133: my ($title, $desc, $link, $pabdate) = split(/\|\|/, $database{$key} );
133: kkb{iiiiii,biiiii,biiiii,biiiiiiii}b=bkkkkk{QQQQQQ,biiiiiiiiiLiiiiRb};
134: #my $datastr=join(/\|\|/,$title,$desc,$link,$pabdate);
134: ######################################################
135: 
135: 
136: my $datastr=$title . "||" . $desc . "||" . $link . "||" . $pabdate;
136: kkbiiiiiiii=iiiiiib.bQQQQb.biiiiib.bQQQQb.biiiiib.bQQQQb.biiiiiiii;
137: 
137: 
138: if($idx<=3)
138: kk{iiii<=n}
139: {
139: {
140: $onedb{$key}=$datastr;
140: iiiiiiLiiiiR=iiiiiiii;
141: $database2{$key}=$datastr;
141: iiiiiiiiiiLiiiiR=iiiiiiii;
142: 
142: 
143: }
143: }
144: if($idx<=3)
144: kk{iiii<=n}
145: {
145: {
146: delete $database{$key};
146: kkkkkkbiiiiiiiiiLiiiiR;
147: }
147: }
148: 
148: 
149: $idx++;
149: iiii++;
150: }
150: }
151: 
151: 
152: undef $db;
152: kkkkkbiii;
153: untie %database;
153: kkkkkbiiiiiiiii;
154: close DATAFILE;
154: kkkkkbwwwwwwww;
155: 
155: 
156: undef $db2;
156: kkkkkbiiii;
157: untie %database2;
157: kkkkkbiiiiiiiiii;
158: close DATAFILE2;
158: kkkkkbwwwwwwwww;
159: 
159: 
160: undef %database;
160: kkkkkbiiiiiiiii;
161: undef %database2;
161: kkkkkbiiiiiiiiii;
162: undef $fd;
162: kkkkkbiii;
163: undef $fd2;
163: kkkkkbiiii;
164: undef my $fidotitl;
164: kkkkkbkkbiiiiiiiii;
165: undef my $kkk;
165: kkkkkbkkbiiii;
166: undef my $title1;
166: kkkkkbkkbiiiiiii;
167: undef my $desc1;
167: kkkkkbkkbiiiiii;
168: undef my $link1;
168: kkkkkbkkbiiiiii;
169: undef my $pabdate1;
169: kkkkkbkkbiiiiiiiii;
170: 
170: 
171: my $fidotitl;
171: kkbiiiiiiiii;
172: my $tui=0;
172: kkbiiii=n;
173: 
173: 
174: open(FILEHANDLE,">/data/ftp/pub/CODE/FIDO/rssbot/pravda.dat") or die ("Cannot open file");
174: kkkk{wwwwwwwwww,QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ}bkkbkkkb{QQQQQQQQQQQQQQQQQQ};
175: 
175: 
176: foreach my $kkk (sort keys %onedb)
176: kkkkkkkbkkbiiiib{kkkkbkkkkbiiiiii}
177: {
177: {
178: 
178: 
179: my ($title1,$desc1,$link1,$pabdate1)=split(/\|\|/, $onedb{$kkk} );
179: kkb{iiiiiii,iiiiii,iiiiii,iiiiiiiii}=kkkkk{QQQQQQ,biiiiiiLiiiiRb};
180: #$title1 = encode("cp866", $title1);
180: ####################################
181: #$desc1 = encode("cp866", $desc1);
181: ##################################
182: #$pabdate1 = encode("cp866", $pabdate1);
182: ########################################
183: 
183: 
184: $Text::Wrap::columns=80;
184: iiiiiiiiiiiiiiiiiiii=nn;
185: $Text::Wrap::separator="\n";
185: iiiiiiiiiiiiiiiiiiiiii=QQQQ;
186: $desc1=wrap("","",$desc1);
186: iiiiii=UUUU{QQ,QQ,iiiiii};
187: 
187: 
188: #print FILEHANDLE " \n";
188: ########################
189: print FILEHANDLE $title1, "\n";
189: kkkkkbYYYYYYYYYYbiiiiiii,bQQQQ;
190: if($tui==0) { $fidotitl=$title1; }
190: kk{iiii==n}b{biiiiiiiii=iiiiiii;b}
191: print FILEHANDLE $desc1, "\n";
191: kkkkkbYYYYYYYYYYbiiiiii,bQQQQ;
192: print FILEHANDLE $link1, "\n";
192: kkkkkbYYYYYYYYYYbiiiiii,bQQQQ;
193: print FILEHANDLE $pabdate1, "\n";
193: kkkkkbYYYYYYYYYYbiiiiiiiii,bQQQQ;
194: print FILEHANDLE "\n";
194: kkkkkbYYYYYYYYYYbQQQQ;
195: $tui++;
195: iiii++;
196: 
196: 
197: }
197: }
198: close FILEHANDLE;
198: kkkkkbwwwwwwwwww;
199: 
199: 
200: my $texxt;
200: kkbiiiiii;
201: my $newtexxt;
201: kkbiiiiiiiii;
202: 
202: 
203: open(FILEH,"</data/ftp/pub/CODE/FIDO/rssbot/pravda.dat") or die ("Cannot open file");
203: kkkk{wwwww,QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ}bkkbkkkb{QQQQQQQQQQQQQQQQQQ};
204: $texxt="";
204: iiiiii=QQ;
205: while (read (FILEH, $newtexxt, 1)) {
205: kkkkkb{kkkkb{wwwww,biiiiiiiii,bn}}b{
206: {
206: {
207: $texxt.=$newtexxt;
207: iiiiii.=iiiiiiiii;
208: }
208: }
209: #chomp(@array=<FILEH>);
209: #######################
210: 
210: 
211: close FILEH;
211: kkkkkbwwwww;
212: 
212: 
213: 
213: 
214: 
214: 
215: my $spool_dir = "/data/ftp/pub/CODE/FIDO/rssbot";
215: kkbiiiiiiiiiib=bQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ;
216: my $OutDir = "$spool_dir/inbound";
216: kkbiiiiiiib=bQQQQQQQQQQQQQQQQQQQQ;
217: my $log_file = "$spool_dir/packet.log";
217: kkbiiiiiiiiib=bQQQQQQQQQQQQQQQQQQQQQQQ;
218: 
218: 
219: my $ftnsubj=$fidotitl;
219: kkbiiiiiiii=iiiiiiiii;
220: #my $ftnbody=join('\n ' @array);
220: ################################
221: my $ftnbody=$texxt;
221: kkbiiiiiiii=iiiiii;
222: 
222: 
223: ${messages}[0]{area}="4.PVT";
223: tLwwwwwwwwR[n]LwwwwR=QQQQQQQ;
224: ${messages}[0]{tonode}="2:467/4";
224: tLwwwwwwwwR[n]LwwwwwwR=QQQQQQQQQ;
225: ${messages}[0]{Fromnode}="2:467/4";
225: tLwwwwwwwwR[n]LwwwwwwwwR=QQQQQQQQQ;
226: ${messages}[0]{From}="Novyny Ukraini";
226: tLwwwwwwwwR[n]LwwwwR=QQQQQQQQQQQQQQQQ;
227: ${messages}[0]{To}="All";
227: tLwwwwwwwwR[n]LwwR=QQQQQ;
228: ${messages}[0]{Subj}=$ftnsubj;
228: tLwwwwwwwwR[n]LwwwwR=iiiiiiii;
229: ${messages}[0]{Body}=$ftnbody;
229: tLwwwwwwwwR[n]LwwwwR=iiiiiiii;
230: ${messages}[0]{ctrlinfo}="TID: FIDOGATE-5.12-a97f4004";
230: tLwwwwwwwwR[n]LwwwwwwwwR=QQQQQQQQQQQQQQQQQQQQQQQQQQQQQ;
231: ${packet_info}{origNet}="467";
231: tLwwwwwwwwwwwRLwwwwwwwR=QQQQQ;
232: ${packet_info}{PassWord}="TRF5UAUA";                             # a8
232: tLwwwwwwwwwwwRLwwwwwwwwR=QQQQQQQQQQ;bbbbbbbbbbbbbbbbbbbbbbbbbbbbb####
233: ${packet_info}{origZone}="2";                              # S   (repeat)
233: tLwwwwwwwwwwwRLwwwwwwwwR=QQQ;bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb##############
234: ${packet_info}{destZone}="2";                             # S   (repeat)
234: tLwwwwwwwwwwwRLwwwwwwwwR=QQQ;bbbbbbbbbbbbbbbbbbbbbbbbbbbbb##############
235: ${packet_info}{origPoint}="444";
235: tLwwwwwwwwwwwRLwwwwwwwwwR=QQQQQ;
236: ${packet_info}{origNode}="4";                          # S   (repeat)
236: tLwwwwwwwwwwwRLwwwwwwwwR=QQQ;bbbbbbbbbbbbbbbbbbbbbbbbbb##############
237: ${packet_info}{destNode}="4";                         # S   (repeat)
237: tLwwwwwwwwwwwRLwwwwwwwwR=QQQ;bbbbbbbbbbbbbbbbbbbbbbbbb##############
238: ${packet_info}{destNet}="467";
238: tLwwwwwwwwwwwRLwwwwwwwR=QQQQQ;
239: # Time format: 17 Oct 22 23:19:06
239: #################################
240: my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
240: kkb{iiii,iiii,iiiii,iiiii,iiii,iiiii,iiiii,iiiii,iiiiii}b=bkkkkkkkkk{kkkk};
241: $year += 1900;
241: iiiiib+=bnnnn;
242: my @abbr = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
242: kkbiiiiib=bqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq;
243: $year = substr($year,2);
243: iiiiib=bkkkkkk{iiiii,n};
244: my $ttime=$mday." ".$abbr[$mon]." ".$year." ".$hour.":".$min.":".$sec;
244: kkbiiiiii=iiiii.QQQ.iiiii[iiii].QQQ.iiiii.QQQ.iiiii.QQQ.iiii.QQQ.iiii;
245: #
245: #
246: 
246: 
247: ${messages}[0]{ftscdate}=$ttime;
247: tLwwwwwwwwR[n]LwwwwwwwwR=iiiiii;
248: ${messages}[0]{DateTime}=$ttime;
248: tLwwwwwwwwR[n]LwwwwwwwwR=iiiiii;
249: ${packet_info}{Area}="4.PVT";
249: tLwwwwwwwwwwwRLwwwwR=QQQQQQQ;
250: ${packet_info}{Origin}=" /RoboNews v.1.3 Novyny Ukraini/ ";
250: tLwwwwwwwwwwwRLwwwwwwR=QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ;
251: ${packet_info}{TearLine}=" *Read us with http://winpoint.org* ";
251: tLwwwwwwwwwwwRLwwwwwwwwR=QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ;
252: 
252: 
253: &write_ftn_packet($OutDir, \%packet_info, \@messages);
253: iiiiiiiiiiiiiiiii{iiiiiii,b\iiiiiiiiiiii,b\iiiiiiiii};
