Acme-ConspiracyTheory-Random

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

  "x_provides_scripts" => { conspire => { file => "bin/conspire" } },
};

my %dynamic_config;

my %WriteMakefileArgs = (
	ABSTRACT   => $meta->{abstract},
	AUTHOR     => ($EUMM >= 6.5702 ? $meta->{author} : $meta->{author}[0]),
	DISTNAME   => $meta->{name},
	VERSION    => $meta->{version},
	EXE_FILES  => [ map $_->{file}, values %{ $meta->{x_provides_scripts} || {} } ],
	NAME       => do { my $n = $meta->{name}; $n =~ s/-/::/g; $n },
	test       => { TESTS => "t/*.t" },
	%dynamic_config,
);

$WriteMakefileArgs{LICENSE} = $meta->{license}[0] if $EUMM >= 6.3001;

sub deps
{
	my %r;

Makefile.PL  view on Meta::CPAN

	$WriteMakefileArgs{PREREQ_PM}          ||= deps('runtime', 'build', 'test');	
}
else
{
	$WriteMakefileArgs{PREREQ_PM}          ||= deps('configure', 'build', 'test', 'runtime');	
}

{
	my ($minperl) = reverse sort(
		grep defined && /^[0-9]+(\.[0-9]+)?$/,
		map $meta->{prereqs}{$_}{requires}{perl},
		qw( configure build runtime )
	);
	
	if (defined($minperl))
	{
		die "Installing $meta->{name} requires Perl >= $minperl"
			unless $] >= $minperl;
		
		$WriteMakefileArgs{MIN_PERL_VERSION} ||= $minperl
			if $EUMM >= 6.48;

lib/Acme/ConspiracyTheory/Random.pm  view on Meta::CPAN

			"$auth are the obvious people to go to",
			"$auth are the only ones with the power to stop them",
			"$auth are able to save us",
		);
	}

	if ( my $p = $redstring->{myth_place} ) {
		push @x, (
			"there are clues about $p in the Bible",
			"there are clues about $p in the Voynich manuscript",
			"$p is on some old maps",
			"$p is on Google Maps",
		);
	}

	if ( my $art = $redstring->{artifact} ) {
		push @x, (
			"$art isn't in any museum",
			"$art must be somewhere",
			"$art is out there",
			"$art can be found with GPS",

lib/Acme/ConspiracyTheory/Random.pm  view on Meta::CPAN

	if ( my $p = $redstring->{random_place} // $redstring->{bad_place} ) {
		my $bad = $redstring->{antagonist}{name}
			// $redstring->{protagonist}{name}
			// $redstring->{shady_group}{name}
			// shady_group( $redstring );
		push @x, (
			"the Wikipedia entry for $p keeps getting edited by $bad",
			# This has singular/plural problems - how to solve?
			"$bad has ties to $p",
			"$p probably isn't a real place anyway",
			"$p isn't shown on any maps",
		);
	}

	for my $actor ( qw/ protagonists antagonists / ) {
		next unless $redstring->{$actor}{name};
		
		my $name   = $redstring->{$actor}{shortname} // $redstring->{$actor}{name};
		my $have   = splural( $redstring->{$actor} ) ? 'have' : 'has';
		my $are    = splural( $redstring->{$actor} ) ? 'are'  : 'is';
		my $s      = splural( $redstring->{$actor} ) ? ''     : 's';

lib/Acme/ConspiracyTheory/Random.pm  view on Meta::CPAN

			push @x, (
				"$name ${( $redstring->{$actor}{plural} ? \'keep' : \'keeps' )} editing the Wikipedia page about $topicname",
				"$name $are known to have ties to $topicname",
				"'$name' is almost an anagram of '$topicname'",
				"'$name' is the Hebrew word for '$topicname'",
				"'$name' is an anagram of '$topicname' (if you spell it wrong)",
			);
		}
	}

	my @evidences = List::Util::uniq( map { _RANDOM_(@x) } 1..2 );
	
	if ( @evidences == 2 ) {
		my ( $e1, $e2 ) = @evidences;
		return _RANDOM_(
			"You can tell this is the truth because $e1, and $e2.",
			( ( "I know because $e1, and $e2." ) x 6 ),
			"You just need to connect the dots. " . _UCFIRST_( "$e1 and $e2." ),
			"I used to be asleep like you, but then I saw the clues. " . _UCFIRST_( "$e1, and $e2. WAKE UP!" ),
			"THEY HIDE THE TRUTH IN PLAIN SIGHT. " . _UCFIRST_( "$e1, and $e2." ),
			"You won't believe how deep the rabbit hole goes. " . _UCFIRST_( "$e1, and $e2." ),

lib/Acme/ConspiracyTheory/Random.pm  view on Meta::CPAN

	92   => [ qr/URANIUM/,           'The atomic number for uranium is 92' ],
	322  => [ qr/SKULL/,             'Skull and Bones is Order 322' ],
	666  => [ qr/DEVIL|DEMON|SATAN/, '666 is the number of the beast' ],
);

sub numerology {
	my $redstring = shift // {};
	
	my @strings = List::Util::uniq(
		grep { length }
		map { my $letters = uc( $_ ); $letters =~ s/[^A-Z0-9]//g; $letters }
		map {
			/^(the )(.+)$/i ? $2 : $_
		}
		map {
			ref( $_ ) ? grep( defined, $_->{name}, $_->{shortname}, $_->{title}, $_->{author} ) : $_
		}
		values( %$redstring )
	);
	
	my %calcs;
	foreach my $string ( @strings ) {
		next if length($string) >= 20;
		my @letters = split //, $string;
		my @numbers = map /[A-Z]/ ? ( ord($_) - 0x40 ) : $_, @letters;
		my $sum     = List::Util::sum( @numbers );
		
		push @{ $calcs{$sum} ||= [] }, sprintf(
			'%s = %s = %s',
			join( '+', @letters ),
			join( '+', @numbers ),
			$sum,
		);
	}
	

lib/Acme/ConspiracyTheory/Random.pm  view on Meta::CPAN

		if ( $calcs{$key} ) {
			my @copy = @{ $special_numbers{$key} };
			while ( @copy ) {
				my ( $test, $statement ) = splice( @copy, 0 , 2 );
				next unless "@strings" =~ $test;
				push @{ $calcs{$key} }, "And guess what? " . $statement;
			}
		}
	}
	
	my @wow = map { @$_ > 1 ? @$_ : () } values %calcs;
	
	if ( @wow ) {
		return sprintf(
			"%s %s",
			_RANDOM_(
				'The numbers never lie.',
				'Trust the numbers.',
				'You can see the truth in the numbers.',
			),
			join(
				'',
				map( "$_. ", @wow ),
			)
		);
	}
	
	return '';
}

sub bad_punctuation {
	my ( $string, $cancel ) = @_;
	unless ( $cancel ) {



( run in 0.261 second using v1.01-cache-2.11-cpan-26ccb49234f )