App-SpreadRevolutionaryDate

 view release on metacpan or  search on metacpan

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

      '1130' => ['cabotière', 'cabotières', 'f'],
      '1201' => ['pique-oeuf', 'pique-oeufs', 'm'],
      '1202' => ['revue de contrat', 'revues de contrats', 'f'],
      '1203' => ['grande surface', 'grandes surfaces', 'f'],
      '1204' => ['manteau de cheminée', 'manteaux de cheminées', 'm'],
      '1205' => ['charentaise', 'charentaises', 'f'],
      '1206' => ['chasse-goupille', 'chasse-goupilles', 'm'],
      '1207' => ['chaussure à orteils', 'chaussures à orteils', 'f'],
      '1208' => ['giroflée à cinq pétales', 'giroflées a cinq pétales', 'f'],
      '1209' => ['salade de phalanges', 'salades de phalanges', 'f'],
      '1210' => ['rogntudju', 'rogntudju', 'm'],
      '1211' => ['lixiviateuse', 'lixiviateuses', 'f'],
      '1212' => ['chaise berçante', 'chaises berçantes', 'f'],
      '1213' => ['chebec', 'chebec', 'm'],
      '1214' => ['boulevard circulaire', 'boulevards circulaires', 'm'],
      '1215' => ['bande cyclable', 'bandes cyclables', 'f'],
      '1216' => ['coupe-boulons', 'coupe-boulons', 'm'],
      '1217' => ['clé à pipe', 'clés à pipe', 'f'],
      '1218' => ['zeugme', 'zeugmes', 'm'],
      '1219' => ['tricordeur à ampoules sous vide', 'tricordeurs à ampoules sous vide', 'm'],
      '1220' => ['diptyque', 'diptyques', 'm'],
      '1221' => ['clavette basculante', 'clavettes basculantes', 'f'],
      '1222' => ['glassophone', 'glassophones', 'm'],
      '1223' => ['métaphore', 'métaphores', 'f'],
      '1224' => ['pentécontère', 'pentécontères', 'm'],
      '1225' => ['sapin à trois roues', 'sapins à trois roues', 'm'],
      '1226' => ['cumulus bourgeonnant', 'cumulus bourgeonnants', 'm'],
      '1227' => ['pyréolophore', 'pyréolophores', 'm'],
      '1228' => ['soubassophone', 'soubassophones', 'm'],
      '1229' => ['vastringue', 'vastringues', 'm'],
      '1230' => ['vocifération sportive', 'vociférations sportives', 'f'],
      '1231' => ['connotation de proximité temporelle', 'connotations de proximité temporelle', 'f'],
    },
  );

  my @telechat_days = ('Lourdi', 'Pardi', 'Morquidi', 'Jourdi', 'Dendrevi', 'Sordi', 'Mitanche');

  my $today = DateTime->now(locale => $self->locale);
  my $day_name = $telechat_days[$today->day_of_week_0];

  my @calendars = sort keys %telechat_calendars;
  my $calendar_key = sprintf("%02d", $today->month).sprintf("%02d", $today->day);
  shift @calendars unless $telechat_calendars{'0tvtime'}->{$calendar_key};
  my $chosen_calendar = @calendars[rand @calendars];
  my $feast = $telechat_calendars{$chosen_calendar}->{$calendar_key};
  my $feast_gender = $feast->[2] eq 'm' ? 'Saint' : 'Sainte';
  my $feast_singular = $feast->[0];
  $feast_singular =~ s/\b(\w)/\U$1/g;
  my $feast_plural = $feast->[1];
  my $every_gender = $feast->[2] eq 'm' ? 'tous' : 'toutes';

  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) {
      $feast_gender = $self->special_birthday_gender eq 'm' ? 'Saint' : 'Sainte';
      $feast_singular = $self->special_birthday_name;
      $feast_plural = $self->special_birthday_plural;
      $every_gender = $self->special_birthday_gender eq 'm' ? 'tous' : 'toutes';
  }

  my $msg = sprintf("Chalut ! Aujourd'hui, %s %d, c'est la %s-%s.\nBonne fête à %s les %s !", $day_name, $today->day, $feast_gender, $feast_singular, $every_gender, $feast_plural);

  my $img_path = dist_file('App-SpreadRevolutionaryDate', 'images/groucha.png');
  my $img_alt = "Grouchat de Téléchat : « $msg »";
  $img_alt =~ s/\n+/ /g;
  my $img = {path => $img_path, alt => $img_alt};

  return ($msg, $img);
}


no Moose;
__PACKAGE__->meta->make_immutable;

# A module must return a true value. Traditionally, a module returns 1.
# But this module is a revolutionary one, so it discards all old traditions.
# Idea borrowed from Jean Forget's DateTime::Calendar::FrenchRevolutionary.
"Quand le gouvernement viole les droits du peuple,
l'insurrection est pour le peuple le plus sacré
et le plus indispensable des devoirs";

__END__

=pod

=encoding UTF-8

=head1 NAME

App::SpreadRevolutionaryDate::MsgMaker::Telechat - MsgMaker class for L<App::SpreadRevolutionaryDate> to build message with Téléchat date

=head1 VERSION

version 0.54

=head1 METHODS

=head2 compute

Computes date of the day similar to the Belgian-French TV show 'Téléchat" on the 1980's. Takes no argument. Returns message as string and hash with the path to an image file of Groucha, the presenter of Téléchat, and its alt text, with 'path' and...

This message maker is greatly based on I<SaintObjetBot> a bot spreading, in "Téléchat style", the date and the feast of the day, see L<https://github.com/tobozo/SaintObjetBot>.

There is no really offical Téléchat calendar (named calendar of holly objects, calendrier des objet saints in French), the principle is to use new inventions of objects instead of outdated objects.

We have found three sources for calendar names: what has actually been broadcasted on tv show, see L<https://www.tvtime.com/fr/show/257185>, and two versions computed by I<SaintObjetBot>, see L<https://github.com/tobozo/SaintObjetBot/blob/main/data/s...

=head1 SEE ALSO

=over

=item L<spread-revolutionary-date>

=item L<App::SpreadRevolutionaryDate>

=item L<App::SpreadRevolutionaryDate::Config>

=item L<App::SpreadRevolutionaryDate::BlueskyLite>

=item L<App::SpreadRevolutionaryDate::Target>

=item L<App::SpreadRevolutionaryDate::Target::Bluesky>



( run in 0.647 second using v1.01-cache-2.11-cpan-df04353d9ac )