Acme-Rando

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

      },
      "develop" : {
         "requires" : {
            "Test::Pod" : "1.41"
         }
      },
      "runtime" : {
         "requires" : {
            "Exporter" : "0",
            "HTTP::Tiny" : "0",
            "JSON" : "0",
            "parent" : "0",
            "strict" : "0",
            "warnings" : "0"
         }
      },
      "test" : {
         "requires" : {
            "Test::More" : "0"
         }
      }

META.yml  view on Meta::CPAN

dynamic_config: 0
generated_by: 'Dist::Zilla version 5.029, CPAN::Meta::Converter version 2.143240'
license: perl
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: '1.4'
name: Acme-Rando
requires:
  Exporter: '0'
  HTTP::Tiny: '0'
  JSON: '0'
  parent: '0'
  strict: '0'
  warnings: '0'
resources:
  homepage: https://github.com/ctriv/perl-Acme-Rando
  repository: https://github.com/ctriv/perl-Acme-Rando.git
version: '0.1'

Makefile.PL  view on Meta::CPAN

  "CONFIGURE_REQUIRES" => {
    "ExtUtils::MakeMaker" => 0
  },
  "DISTNAME" => "Acme-Rando",
  "EXE_FILES" => [],
  "LICENSE" => "perl",
  "NAME" => "Acme::Rando",
  "PREREQ_PM" => {
    "Exporter" => 0,
    "HTTP::Tiny" => 0,
    "JSON" => 0,
    "parent" => 0,
    "strict" => 0,
    "warnings" => 0
  },
  "TEST_REQUIRES" => {
    "Test::More" => 0
  },
  "VERSION" => "0.1",
  "test" => {
    "TESTS" => "t/*.t"
  }
);


my %FallbackPrereqs = (
  "Exporter" => 0,
  "ExtUtils::MakeMaker" => 0,
  "HTTP::Tiny" => 0,
  "JSON" => 0,
  "Test::More" => 0,
  "parent" => 0,
  "strict" => 0,
  "warnings" => 0
);


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

dist.ini  view on Meta::CPAN

name	= Acme-Rando
version = 0.1
author  = Chris Reinhardt <crein@cpan.org>
license = Perl_5
copyright_holder = Liquid Web Inc.

[GatherDir]
[GithubMeta]
	homepage = https://github.com/ctriv/perl-Acme-Rando
[MetaYAML]
[MetaJSON]
[MakeMaker]
[Manifest]
[PruneCruft]
[License]
[ExtraTests]
[PodSyntaxTests]
[PkgVersion]
[PodVersion]
[ReadmeAnyFromPod]
[ReadmeAnyFromPod / ReadmePodInRoot]

lib/Acme/Rando.pm  view on Meta::CPAN

package Acme::Rando;
$Acme::Rando::VERSION = '0.1';
use strict;
use warnings;

use HTTP::Tiny;
use JSON;

use parent 'Exporter';
our @EXPORT = qw(rando);


  
=head1 NAME

Acme::Rando - Get a Random Star Wars quote

lib/Acme/Rando.pm  view on Meta::CPAN


=cut

sub rando {
	my $res = HTTP::Tiny->new->get('http://www.iheartquotes.com/api/v1/random?source=starwars&format=json');
	
	unless ($res->{success}) {
		return "These aren't the droids you're looking for: $res->{reason}"
	}
	
	my $dat  = JSON::decode_json($res->{content});
	
	return $dat->{quote};
}

=head1 AUTHORS

    Chris Reinhardt
    crein@cpan.org
    
=head1 COPYRIGHT



( run in 0.752 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )