###PERL_LIB: use lib '/botm/lib/post';
use botm_common (
'read_data_file', 'write_data_file',
- 'url_encode', 'url_decode',
- 'join_path',
- 'html_entity_decode'
+ 'merge_url',
);
###PERL_ENCODING_FILE_IN: use constant ENCODING_FILE_IN => 'UTF-8';
" -p, --password=PASSWORD\n".
" -t, --subject=POST_SUBJECT\n".
" -c, --content=POST_CONTENT\n".
+ " -e, --edit=POST_ID\n".
"\n".
" -d, --data-only\n".
"\n".
'password|p=s' => \$options{'password'},
'subject|t=s' => \$options{'subject'},
'content|c=s' => \$options{'content'},
+ 'edit|e=s' => \$options{'edit'},
'data-only|d' => \$options{'data-only'},
'help|h' => \$options{ 'help'}
);
-print html_entity_decode(
- 'illegal: "&" -' . "\n".
- 'name(gt): ">" -' . "\n".
- 'name_inf(gta): ">a" -' . "\n".
- 'decimal(126): "~" -' . "\n".
- 'hexadecimal(7E). "~" -' . "\n".
- 'bad names: Y;&enhedksdh; -' . "\n".
- 'finally, some text :> -'
-)."\n";
-
-
-# print html_entity_encode_dec ('<a ="bleb & ęóąśłżźćń my ziom"/>')."\n";
-# print html_entity_encode_hex ('<a ="bleb & ęóąśłżźćń my ziom"/>')."\n";
-# print html_entity_encode_name('<a ="bleb & ęóąśłżźćń my ziom"/>')."\n";
-# print html_entity_encode_dec ('<a ="bleb & ęóąśłżźćń my ziom"/>', 1)."\n";
-# print html_entity_encode_hex ('<a ="bleb & ęóąśłżźćń my ziom"/>', 1)."\n";
-# print html_entity_encode_name('<a ="bleb & ęóąśłżźćń my ziom"/>', 1)."\n";
-exit 0;
-
if ($options{'help'} ne '') {
print HELP_TEXT;
exit 0;
$options{'mirror-url'} = MIRROR_URL;
}
+post_to_mirror();
+exit 0;
+
print "options:\n";
my $a = write_data_file(\*STDOUT, ENCODING_STD_OUT, 0, \%options);
print "$a\n";
-foreach my $ind (keys %options) {
- print $ind.'=>'.url_decode($options{$ind})."<\n";
-}
-print;
+
foreach my $arg (@ARGV) {
print "\nFILE $arg\n";
my %data = read_data_file($arg, 'utf8', 1);
sub post_to_mirror {
(my $cmd_options, my $post) = @_;
- my $post_url = join_path('/', $cmd_options->{'mirror-url'}, 'post');
+ my $post_url = merge_url($options{'mirror-url'}, 'post');
+
+ print $post_url."\n";
}