App-mokupona
view release on metacpan or search on metacpan
script/moku-pona view on Meta::CPAN
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
=encoding utf8
=head1 Moku Pona
Moku Pona is a Gemini based feed reader. It can monitor URLs to feeds or regular
pages for changes and keeps and updated list of these in a Gemini list. Moku
Pona knows how to fetch Gopher URLs, Gemini URLs, and regular web URLs.
You manage your subscriptions using the command-line, with Moku Pona.
You serve the resulting file using a Gemini server.
You read it all using your Gemini client.
=head2 Limitations
When Moku Pona isn't watching a feed it can only detect changes on a page. Thus,
if there is an item that points to a phlog or blog, that's great. Sometimes
people put their phlog in a folder per year. If the Gopher menu lists each
folder and a date with the latest change, then that's great, you can use it.
Without it, you're in trouble: you need to subscribe to the item for the current
year in order to see changes, but when the next year comes around, you're
subscribed to the wrong item. Sometimes you're lucky and there will be a menu
somewhere with a timestamp for the last change. Use that instead. Good luck!
=head2 License
GNU Affero General Public License
=head2 Installation
Using C<cpan>:
cpan App::mokupona
Manual install:
perl Makefile.PL
make
make install
=head2 Dependencies
There are some Perl dependencies you need to satisfy in order to run this
program:
=over
=item L<Modern::Perl>, or C<libmodern-perl-perl>
=item L<Mojo::IOLoop>, or C<libmojolicious-perl>
=item L<XML::LibXML>, or C<libxml-libxml-perl>
=item L<URI::Escape>, or C<liburi-escape-xs-perl>
=item L<Encode::Locale>, or c<libencode-locale-perl>
=back
=cut
use Modern::Perl '2018';
use File::Copy qw(copy);
use Encode::Locale qw(decode_argv);
use Encode qw(decode_utf8);
use Mojo::IOLoop;
use XML::LibXML;
use URI::Escape;
use List::Util qw(none);
decode_argv();
if (-t) {
binmode(STDIN, ":encoding(console_in)");
binmode(STDOUT, ":encoding(console_out)");
binmode(STDERR, ":encoding(console_out)");
}
=head2 The Data Directory
Moku Pona keeps the list of URLs you are subscribed to in directory. It's
probably C<~/.moku-pona> on your system.
=over
=item If you have the C<MOKU_PONA> environment variable set, then that's your data
directory.
=item If you have the C<XDG_DATA_HOME> environment variable set, then your data
directory is F<$XDG_DATA_HOME/moku-pona>.
=item If you you have the C<HOME> environment variable set, and you have a
F<$HOME/.local> directory, then your data directory is
F<$HOME/.local/moku-pona>.
=item If you have the C<HOME> environment variable set, then your data directory
is F<$HOME/.moku-pona>.
=item If you have the C<APPDATA> environment variable set (Windows), then your
data directory is F<$APPDATA/moku-pona>.
=item The last option is to have the C<LOGDIR> environment variable set.
=back
The data directory contains a copy of the latest resources. The names of these
cache files are simply the URL with all the slashes replaced by a hyphen.
=cut
our $data_dir = data_dir();
# say "Using $data_dir";
sub data_dir {
return $ENV{MOKU_PONA} if $ENV{MOKU_PONA};
# find an existing directory
( run in 1.909 second using v1.01-cache-2.11-cpan-bbcb1afb8fc )