2022-12-02 09:05:36 +01:00
|
|
|
#!/usr/bin/perl --
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
use utf8;
|
|
|
|
use feature qw(say);
|
|
|
|
|
|
|
|
my $file = $0;
|
|
|
|
$file =~ s/\.pl$/\.txt/;
|
|
|
|
|
|
|
|
local $/=undef;
|
|
|
|
my $text = <DATA>;
|
|
|
|
|
2022-12-04 02:14:25 +01:00
|
|
|
# change multiple spaces and line feeds to single space
|
|
|
|
# it required for F-droid android client.
|
2022-12-02 09:05:36 +01:00
|
|
|
$text =~ s/[\x00-\x20]+/ /g;
|
2022-12-04 02:14:25 +01:00
|
|
|
|
|
|
|
# remove head/tail space
|
2022-12-02 09:05:36 +01:00
|
|
|
$text =~ s/\A //;
|
|
|
|
$text =~ s/ \z//;
|
2022-12-02 21:30:04 +01:00
|
|
|
|
2022-12-04 02:14:25 +01:00
|
|
|
# HTML block elements and "br".
|
|
|
|
my $blockElements = join "|", qw(
|
|
|
|
address article aside blockquote canvas dd div dl dt
|
|
|
|
fieldset figcaption figure footer form
|
|
|
|
h1 h2 h3 h4 h5 h6 header hr li
|
|
|
|
main nav noscript ol p pre section table tfoot ul video
|
|
|
|
br
|
|
|
|
);
|
|
|
|
|
2022-12-04 02:20:48 +01:00
|
|
|
# block tag it may have attributes, and spaces before/after tag.
|
|
|
|
my $trimElementsRe = qr!\s*(</?(?:$blockElements)\b(?:[^>/"]+|"[^"]*")*/?>)\s*!i;
|
|
|
|
|
|
|
|
## verbose debugging.
|
|
|
|
#say $trimElementsRe;
|
|
|
|
#while( $text =~ /$trimElementsRe/g){
|
|
|
|
# next if $& eq $1;
|
|
|
|
# say "[$&] => [$1]";
|
|
|
|
#}
|
2022-12-04 02:14:25 +01:00
|
|
|
|
|
|
|
# trim spaces before/after block tags. also <br>,<br/>,</br>
|
|
|
|
$text =~ s/$trimElementsRe/$1/g;
|
2022-12-02 09:05:36 +01:00
|
|
|
|
|
|
|
open(my $fh,">:utf8",$file) or die "$file $!";
|
|
|
|
say $fh $text;
|
|
|
|
close($fh) or die "$file $!";
|
|
|
|
|
2022-12-02 21:30:04 +01:00
|
|
|
# apt-cyg install tidy libtidy5
|
2022-12-02 09:49:28 +01:00
|
|
|
system qq(tidy -q -e $file);
|
2022-12-02 09:05:36 +01:00
|
|
|
|
|
|
|
__DATA__
|
|
|
|
|
|
|
|
<p>Mastodon client for Android 8.0 or later.</p>
|
|
|
|
|
|
|
|
<p>Also this app has partially support for Misskey. But it does not include function to use message, drive, reversi, widget.</p>
|
|
|
|
|
2022-12-02 09:49:28 +01:00
|
|
|
<p><b>Multiple accounts, Multiple columns</b></p>
|
2022-12-02 09:05:36 +01:00
|
|
|
<ul>
|
|
|
|
<li>You can swipe horizontally to switch columns and accounts.</li>
|
|
|
|
<li>You can add, remove, rearrange columns.</li>
|
|
|
|
<li>Column types: home, notification, local-TL, federate-TL, search, hash tags, conversation, profile, muted, blocked, follow requests, etc.</li>
|
|
|
|
</ul>
|
|
|
|
|
2022-12-02 09:49:28 +01:00
|
|
|
<p><b>Cross account action</b></p>
|
2022-12-02 09:05:36 +01:00
|
|
|
<ul>
|
|
|
|
<li>You can favorite/follow operation as a user different from bind to column.</li>
|
|
|
|
</ul>
|
|
|
|
|
2022-12-02 09:49:28 +01:00
|
|
|
<p><b>Other information</b></p>
|
2022-12-02 09:05:36 +01:00
|
|
|
<ul>
|
|
|
|
<li>source code is here. <a href="https://github.com/tateisu/SubwayTooter">https://github.com/tateisu/SubwayTooter</a></li>
|
|
|
|
<li>Some of the icons used in this app is based on the Icons8. <a href="https://icons8.com/license/">https://icons8.com/license/</a></li>
|
|
|
|
</ul>
|