Acme-Free-Public-APIs

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

   "prereqs" : {
      "configure" : {
         "requires" : {
            "ExtUtils::MakeMaker" : "0"
         }
      },
      "runtime" : {
         "requires" : {
            "Dispatch::Fu" : "1.06",
            "HTTP::Tiny" : "0",
            "JSON" : "0",
            "Util::H2O::More" : "v0.4.2",
            "perl" : "5.010"
         }
      },
      "test" : {
         "requires" : {
            "Dispatch::Fu" : "1.06",
            "HTTP::Tiny" : "0",
            "JSON" : "0",
            "Test::More" : "0",
            "Util::H2O::More" : "v0.4.2",
            "perl" : "5.010"
         }
      }
   },
   "release_status" : "stable",
   "resources" : {
      "homepage" : "https://github.com/oodler577/p5-Acme-Free-Public-APIs",
      "repository" : {
         "type" : "git",
         "url" : "https://github.com/oodler577/p5-Acme-Free-Public-APIs.git",
         "web" : "https://github.com/oodler577/p5-Acme-Free-Public-APIs"
      }
   },
   "version" : "0.9.10",
   "x_generated_by_perl" : "v5.40.0",
   "x_serialization_backend" : "Cpanel::JSON::XS version 4.38",
   "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later"
}

META.yml  view on Meta::CPAN

---
abstract: "Perl API client for FreePublicAPI.com's API for for listing APIs."
author:
  - 'oodler <oodler@cpan.org>'
build_requires:
  Dispatch::Fu: '1.06'
  HTTP::Tiny: '0'
  JSON: '0'
  Test::More: '0'
  Util::H2O::More: v0.4.2
  perl: '5.010'
configure_requires:
  ExtUtils::MakeMaker: '0'
dynamic_config: 0
generated_by: 'Dist::Zilla version 6.032, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: '1.4'
name: Acme-Free-Public-APIs
requires:
  Dispatch::Fu: '1.06'
  HTTP::Tiny: '0'
  JSON: '0'
  Util::H2O::More: v0.4.2
  perl: '5.010'
resources:
  homepage: https://github.com/oodler577/p5-Acme-Free-Public-APIs
  repository: https://github.com/oodler577/p5-Acme-Free-Public-APIs.git
version: 0.9.10
x_generated_by_perl: v5.40.0
x_serialization_backend: 'YAML::Tiny version 1.74'
x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later'

Makefile.PL  view on Meta::CPAN

  "DISTNAME" => "Acme-Free-Public-APIs",
  "EXE_FILES" => [
    "bin/freeapi"
  ],
  "LICENSE" => "perl",
  "MIN_PERL_VERSION" => "5.010",
  "NAME" => "Acme::Free::Public::APIs",
  "PREREQ_PM" => {
    "Dispatch::Fu" => "1.06",
    "HTTP::Tiny" => 0,
    "JSON" => 0,
    "Util::H2O::More" => "0.4.2"
  },
  "TEST_REQUIRES" => {
    "Dispatch::Fu" => "1.06",
    "HTTP::Tiny" => 0,
    "JSON" => 0,
    "Test::More" => 0,
    "Util::H2O::More" => "0.4.2"
  },
  "VERSION" => "0.9.10",
  "test" => {
    "TESTS" => "t/*.t"
  }
);


my %FallbackPrereqs = (
  "Dispatch::Fu" => "1.06",
  "HTTP::Tiny" => 0,
  "JSON" => 0,
  "Test::More" => 0,
  "Util::H2O::More" => "0.4.2"
);


unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
  delete $WriteMakefileArgs{TEST_REQUIRES};
  delete $WriteMakefileArgs{BUILD_REQUIRES};
  $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
}

dist.ini  view on Meta::CPAN

name    = Acme-Free-Public-APIs
license = Perl_5
author  =  oodler <oodler@cpan.org>
copyright_holder = oodler 
copyright_year = 2024
[@Basic]
[VersionFromModule]
[MetaJSON]
[GithubMeta]
homesite = https://github.com/oodler577/p5-Acme-Free-Public-APIs.git
[KwaliteeTests]
[CheckChangeLog]
[Prereqs]
perl              = >= 5.010
Util::H2O::More   = >= 0.4.2
Dispatch::Fu      = >= 1.06
HTTP::Tiny        = 0
JSON              = 0
[Prereqs / TestPrereqs]
-phase = test
perl              = >= 5.010
Test::More        = 0
Util::H2O::More   = >= 0.4.2
Dispatch::Fu      = >= 1.06
HTTP::Tiny        = 0
JSON              = 0
[PruneCruft]
[PruneFiles]
filename = .git
filename = releases
[ExecDir]
dir = bin

lib/Acme/Free/Public/APIs.pm  view on Meta::CPAN

package Acme::Free::Public::APIs;

use strict;
use warnings;

our $VERSION = '0.9.10';

use HTTP::Tiny;
use JSON            qw/decode_json/;
use Util::H2O::More qw/baptise d2o HTTPTiny2h2o/;

use constant {
    BASEURL => "https://www.freepublicapis.com/api/",
};

sub new {
    my $pkg  = shift;
    my $self = baptise { ua => HTTP::Tiny->new }, $pkg;
    return $self;

lib/Acme/Free/Public/APIs.pm  view on Meta::CPAN

Contributed as part of the B<FreePublicPerlAPIs> Project described at,
L<https://github.com/oodler577/FreePublicPerlAPIs>.

This fun module is to demonstrate how to use L<Util::H2O::More> and
L<Dispatch::Fu> to make creating easily make API SaaS modules and
clients in a clean and idiomatic way. These kind of APIs tracked at
L<https://www.freepublicapis.com/> are really nice for fun and practice
because they don't require dealing with API keys in the vast majority of cases.

This module is the first one written using L<Util::H2O::More>'s C<HTTPTiny2h2o>
method that looks for C<JSON> in the C<content> key returned via L<HTTP::Tiny>'s
response C<HASH>.

=head1 METHODS

=over 4

=item C<new>

Instantiates object reference. No parameters are accepted.

lib/Acme/Free/Public/APIs.pm  view on Meta::CPAN


Naturally, it can be used with the commandline to sort on other fields such
as C<health>, e.g.:

  shell> freeapi apis | sort -k2 -r -n | less # sorting on column #2
  321  100 Church Calendar API
  191  100 IP Geolocation & Currency Converter
  129  100 IP Geolocation API
   92   99 French Address API
   94   95 Carbon Intensity API
   90   95 JSONPlaceholder
   88   95 Stadt Land Fluss
   80   95 Dungeons and Dragons
   77   95 Digimon API
   75   95 Rick and Morty API
   72   95 kanye.rest
   71   95 Coinpaprika API
   70   95 Met Museum Collection
   68   95 Data USA
   62   95 Harry Potter API
   54   95 Star Wars API



( run in 2.504 seconds using v1.01-cache-2.11-cpan-cdf2f3d4e48 )