App-SpreadRevolutionaryDate

 view release on metacpan or  search on metacpan

lib/App/SpreadRevolutionaryDate/MsgMaker/PromptUser.pm  view on Meta::CPAN

  }

  my $confirm = $confirm_nok;
  my $msg;
  while (defined $confirm && $confirm !~ qr($confirm_ok)) {
    $msg = prompt($question, $self->default);
    $confirm = prompt(
      message  => $confirm_intro . ' "' . $msg . '", ' . $confirm_question,
      default  => $confirm_ok,
      validate => qr/^[$confirm_ok$confirm_nok]$/i,
      escape   => qr/^$confirm_abort$/,
      error    => $confirm_error,
      tries    => 2,
    );
  }
  die "$abort\n" unless defined $confirm && $confirm =~ qr($confirm_ok);

  if ($self->img_path) {
    return ($msg, {path => $self->img_path, alt => $self->img_alt});
  } elsif ($self->img_url) {
    my $ua = LWP::UserAgent->new(env_proxy => 1, timeout => 10, agent =>'App::SpreadRevolutionaryDate bot');

lib/App/SpreadRevolutionaryDate/MsgMaker/RevolutionaryDate.pm  view on Meta::CPAN

      year       => $revolutionary->year,
      feast_long => $feast_long,
      time       => $revolutionary->hms,
  );

  if ($self->special_birthday_day && $self->special_birthday_month && $self->special_birthday_name && $today->day == $self->special_birthday_day && $today->month == $self->special_birthday_month && $self->special_birthday_url) {
      $msg .= ' ' . $self->special_birthday_url;
  } elsif ($self->wikipedia_link) {
    use URI::Escape;
    my $entry = $revolutionary->locale->wikipedia_redirect($revolutionary->month, $revolutionary->feast_short);
    $msg .= ' https://' . $self->locale . '.wikipedia.org/wiki/' . uri_escape_utf8($entry);
  }

  return ($msg, undef);
}


no Moose;
__PACKAGE__->meta->make_immutable;

# A module must return a true value. Traditionally, a module returns 1.



( run in 0.942 second using v1.01-cache-2.11-cpan-73692580452 )