App-SpreadRevolutionaryDate

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

NAME

    spread-revolutionary-date - Spread date and time from Revolutionary
    (Republican) Calendar

VERSION

    version 0.54

DESCRIPTION

    spread-revolutionary-date is a Free Software
    <https://www.gnu.org/philosophy/free-sw.html> that spreads the current
    date, expressed in the French Revolutionary calendar
    <https://en.wikipedia.org/wiki/French_Republican_calendar>, to various
    social networks: Mastodon <https://mastodon.social/>, Bluesky
    <https://bsky.app/>, Twitter <https://twitter.com/>, the Liberachat
    <https://libera.chat/> and Freenode <https://freenode.net/> Internet
    Relay Chat networks.

    Moreover, you can easily extend these defaults targets with any desired
    one, see "EXTENDING TO NEW TARGETS", and even spread something else
    than the revolutionary date, see "msgmaker" option and "EXTENDING TO
    NEW MESSAGE MAKERS".

    The French Revolutionary calendar, also called Republican calendar, was
    introduced during the French Revolution
    <https://en.wikipedia.org/wiki/French_Revolution>, and used from late
    1793 to 1805, and also during the Paris Commune
    <https://en.wikipedia.org/wiki/Paris_Commune> in 1871. This was an
    attempt to get rid of religious and royalist references found in
    Gregorian calendar when naming measures of Time. Months were given new
    names based on nature, each day of the year, instead of being named
    after an associated saint, had a unique name associated with the rural
    economy: agricultural tools, common animals, grains, pastures, trees,
    roots, flowers, fruits, plants, and minerals. But this was also an
    attempt to give more rational in measuring Time, basing measures on
    decimal system. Instead of weeks, each month was divided into exactly 3
    décades, that is ten days; days were divided into ten hours; hours into
    100 minutes; and minutes into 100 seconds.

    You must have a registered account on each of the targets you want to
    spread the revolutionary date. And you must get credentials for
    spread-revolutionary-date to post on Mastodon, Bluesky and Twitter, and
    also for IA generated messages with Gemini message maker. Finally, you
    have to configure spread-revolutionary-date to use these credentials,
    see "CONFIGURATION" and "COMMAND LINE PARAMETERS" below.

    The revolutionary date and time is computed thanks to the
    DateTime::Calendar::FrenchRevolutionary Perl module, by Jean Forget.

USAGE

      # Just execute the script in your shell
      # to spread current date to configured accounts
      # to Bluesky, Twitter, Mastodon, Freenode and Liberachat:
      $ spread-revolutionary-date
    
      # Or, since this script does nothing but calling
      # the L<App::SpreadRevolutionaryDate> Perl module,
      # use this one-liner:
      $ perl -MApp::SpreadRevolutionaryDate \
          -e 'App::SpreadRevolutionaryDate->new->spread;'
    
      # Test spreading to Mastodon only:
      $ spread-revolutionary-date \
          --targets=Mastodon --test
    
      # Test spreading to Twitter only in English:
      $ spread-revolutionary-date \
          --targets=Twitter \
          --test \
          --locale en
    
      # Spread acab time to Twitter and Liberachat
      # explicit channels
      $ spread-revolutionary-date \
          --targets=Twitter \
          --targets=Liberachat \
          --liberachat_channels='#revolution' \
          --liberachat_channels='#acab' \
          --revolutionarydate_acab
    
      # Prompt user for a message to spread to Mastodon
      $ spread-revolutionary-date \
          --targets=Mastodon \
          --msgmaker=UserPrompt
    
      # Spread message as command line parameter to
      # Mastodon, Bluesky, Twitter, Liberachat and Freenode
      $ spread-revolutionary-date \
          --msgmaker=UserPrompt \

README  view on Meta::CPAN

    module that are localizable, like month_name, you should use the
    "locale" option to have it translated in the desired language.

    And now you are ready to spread whatever your like, with just some
    configuration tweaks!

    Be aware that Gemini, like any other AI, has no concept of truth. It
    can only give formally probable answers, based on its training data. So
    do not ask somehing where truth matters… Also, all data you're sending
    to Gemini are assumed to not be private anymore and could be used by
    Google for any purpose! And finally, keep in mind that each request to
    Gemini AI consumes a huge amount of resources, which is detrimental to
    the environment.

INTERNATIONALIZATION AND LOCALIZATION

    Starting from version 0.11, this distribution uses the widespread
    internationalization and localization system gettext
    <https://en.wikipedia.org/wiki/Gettext>, commonly used for writing
    multilingual programs. See GNU gettext documentation
    <https://www.gnu.org/software/gettext/gettext.html> for details. From
    the point of view of a translator, this is rather simple.

    Translators can find a portable object template
    po/App-SpreadRevolutionaryDate.pot which includes all translatable
    strings used by spread-revolutionary-date (but not translations of
    days, months, feasts used in the French Revolutionary Calendar, see
    below). They can copy this template to a portable object file of their
    language and translate strings of this file. For example, a German
    translator would work on po/de.po. All strings to be translated are
    laid down in lines beginning with msgid keyword, and translations
    should go on the next line beginning with keyword msgstr. E.g.:

      msgid "Please, enter message to spread"

    A German translator would have to replace the next line:

     msgstr ""

    by:

     msgstr "Bitte geben Sie die Nachricht zu verbreiten ein"

    When the string to be translated includes some words in curly braces,
    these words are actually named variables and should be left as is in
    the translation. E.g.:

      msgid "or {abort} to abort"
      msgstr "oder {abort}, um abzubrechen"

    And that's it! As of version 0.11 of spread-revolutionary-date, there
    is only about a dozen of strings to translate, mainly for PromptUser
    message maker. But with the possibility to extend to other message
    makers, you may need more and more strings to be translated.

    Translating days, months and feasts used in the RevolutionaryDate
    message maker do not use the gettext system. Mainly because it uses
    DateTime::Calendar::FrenchRevolutionary which proposes French and
    English translations in dedicated Perl modules.
    spread-revolutionary-date keeps the same way for translating
    expressions used in the French revolutionary calendar, but, thanks to
    Moose::Role
    App::SpreadRevolutionaryDate::MsgMaker::RevolutionaryDate::Locale,
    translatable nominal groups have been isolated from other Perl code.
    Their translations lie in a consuming class in the
    App::SpreadRevolutionaryDate::MsgMaker::RevolutionaryDate::Locale::
    namespace for each translated language. These classes are named after
    the two-letter (ISO 639-1 <https://en.wikipedia.org/wiki/ISO_639-1>) or
    three-letter (ISO 639-2 <https://en.wikipedia.org/wiki/ISO_639-2> and
    ISO 639-3 <https://en.wikipedia.org/wiki/ISO_639-3>) lowercase
    abbreviation of the corresponding language. For example, a German
    translator would work on
    App::SpreadRevolutionaryDate::MsgMaker::RevolutionaryDate::Locale::de
    class.

    Just copy the French class (from
    lib/App/SpreadRevolutionaryDate/MsgMaker/RevolutionaryDate/Locale/fr.pm
    file) into the desired language, change the name of the class and
    replace every French string. E.g.: the names of the months should be
    replace in:

      has '+months' => (
        default => sub {[
          'Vendémiaire', 'Brumaire',  'Frimaire',
          'Nivôse',      'Pluviôse',  'Ventôse',
          'Germinal',    'Floréal',   'Prairial',
          'Messidor',    'Thermidor', 'Fructidor',
          'jour complémentaire',
        ]},
      );

    by names in German:

      has '+months' => (
        default => sub {[
          'Herbstmonat',    'Nebelmonat',  'Reifmonat',
          'Schneemonat',    'Regenmonat',  'Windmonat',
          'Keimmonat',      'Blütenmonat', 'Wiesenmonat',
          'Erntemonat',     'Hitzemonat',  'Fruchtmonat',
          'Ergänzungstage',
        ]},
      );

    Feasts include a special trick, because they can be used in sentences
    like this is feast name day or c'est le jour de la feast name.
    Depending on the language, it could then be prefixed or suffixed: in
    English it is suffixed by  day, whereas in French it is prefixed by
    jour de la . Prefixes are translated as an array of strings, while the
    suffix is translated in a single string. The reason is that in
    languages where the feast of the day is prefixed, the prefix often
    depends on the gender or the number of the noun used for the feast, or
    whereas this noun starts by a vowel, and other factors depending on the
    language. Therefore, each translation of the feast of each day should
    starts with a digit specifying the index (starting from 0) in the
    translated array of prefixes to use for this word. E.g.: with prefixes
    translated by ['jour du ', 'jour de la ', "jour de l'", 'jour des '],
    some feast can be translated by '1carotte', '2amaranthe', '0panais'
    (because you say: jour de la carotte, with prefix number 1, jour de
    l'amaranthe, with prefix number 2, and jour du panais, with prefix
    number 0). If the language does not use any prefix before the feast of
    the day, each translation for the feast of the day should start with 0,



( run in 0.795 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )