The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

App::MergeCal

ABSTRACT

Command line program that merges iCal files into a single calendar.

SYNOPSIS

    use App::MergeCal;

    my $app = App::MergeCal->new;
    $app->run;

    # Or, more likely, use the mergecal program

METHODS

$app->calendars, $app->title, $app->output

Accessors for fields.

$app->run

Main driver method.

$app->gather

Access all of the calendars and gather their contents into $objects.

$app->render

Take all of the objects in $objects and write them to an output file.

$app->clean_calendars

Ensure that all of the calendars are URIs. If a calendar doesn't have a scheme then it is assumed to be a file URI.

App::MergeCal->new, App::MergeCal->new_from_json, App::MergeCal->new_from_json_file

Constructor methods.

new

Constructs an object from a hash of attribute/value pairs

new_from_json

Constructs an object from a JSON string representing attribute/value pairs.

new_from_json_file

Constructs an object from a file containing a JSON string representing attribute/value pairs.

CONFIGURATION

The behaviour of the program is controlled by a JSON file. The default name for this file is config.json. The contents of the file will look something like this:

    {
      "title":"My Combined Calendar",
      "output":"my_calendar.ics",
      "calendars":[
        "https://example.com/some_calendar.ics",
        "https://example.com/some_other_calendar.ics",
      ]
    }

This configuration will read the the calendars from the URLs listed and combine their contents into a file called my_calendar.ics (which you will presumably make available on the internet).

The <output> configuration option is optional. If it is omitted, then the output will be written to STDOUT.

AUTHOR

Dave Cross <dave@perlhacks.com>

LICENSE

Copyright (C) 2024, Magnum Solutions Ltd. All Rights Reserved.

This script is free software; you can redistribute it and/or modify it under the same terms as Perl itself.