logo

ap-client

CLI-based client / toolbox for ActivityPub Client-to-Servergit clone https://hacktivis.me/git/ap-client.git

ap-represent (786B)


  1. #!/usr/bin/env perl
  2. # AP-Client: CLI-based client / toolbox for ActivityPub
  3. # Copyright © 2020-2023 AP-Client Authors <https://hacktivis.me/git/ap-client/>
  4. # SPDX-License-Identifier: BSD-3-Clause
  5. use strict;
  6. use utf8;
  7. use open ":std", ":encoding(UTF-8)";
  8. our $VERSION = 'v0.1.4';
  9. use JSON;
  10. use App::ActivityPubClient qw(print_object);
  11. =head1 NAME
  12. ap-represent - Pretty-print ActivityStreams data
  13. =head1 SYNOPSIS
  14. B<ap-represent>
  15. =head1 DESCRIPTION
  16. ap-represent takes JSON-formatted ActivityStreams data from standard input and
  17. pretty prints it to stdout.
  18. Said output isn't made to be readable by machines, only humans.
  19. =head1 LICENSE
  20. BSD-3-Clause
  21. =cut
  22. undef $/;
  23. # from_json because UTF-8 is already decoded
  24. my $blob = from_json(<STDIN>);
  25. print_object(1, $blob);
  26. print "\n";