Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
ae07235
Refactoring towards CPAN module.
bigpresh Oct 30, 2014
8d2c915
Document configuring via ~/.netrc
bigpresh Oct 30, 2014
701fd13
This is only used by the script now
bigpresh Oct 31, 2014
d1d85b1
Script should use Getopt::Long
bigpresh Oct 31, 2014
5bdffd0
Use LWP::UserAgent so we can send User-Agent.
bigpresh Oct 31, 2014
427952f
Add a Makefile.PL
bigpresh Oct 31, 2014
29d10ce
Add MANIFEST
bigpresh Oct 31, 2014
1469bfe
Move script to bin/
bigpresh Oct 31, 2014
d3af533
Add script to EXE_FILES
bigpresh Oct 31, 2014
5d94fde
Make Net::Google::Calendar object mockable.
bigpresh Nov 1, 2014
312f04e
Start of tests using mocking
bigpresh Nov 1, 2014
0682b8b
Add Test::MockObject to BUILD_REQUIRES
bigpresh Nov 1, 2014
c3ed64e
Supply wider "window" to iCal::Parser
bigpresh Nov 1, 2014
e651b7f
use Net::Google::Calendar::Event;
bigpresh Nov 1, 2014
fe90ed8
It's Net::Google::Calendar::Entry, not ::Event
bigpresh Nov 1, 2014
19e98e7
For each ical file, check results look sane.
bigpresh Nov 2, 2014
4585943
test ical data
bigpresh Nov 2, 2014
ca374d8
New recurring test, and look for ical data in new place
bigpresh Nov 2, 2014
f6027aa
Wipe all events between tests by default.
bigpresh Nov 2, 2014
bb487dc
Expectation for test1.data
bigpresh Nov 2, 2014
1905066
Compare against summarised events representation.
bigpresh Nov 2, 2014
665c9ab
update_google_calendar doesn't return success/fail
bigpresh Nov 2, 2014
31d96bf
Recurring event test data
bigpresh Nov 2, 2014
7c640eb
Switch to Data::ICal
bigpresh Nov 2, 2014
e1d75ac
Updated deps - Data::ICal etc.
bigpresh Nov 3, 2014
b9c3b35
Test that recurrence is recorded correctly.
bigpresh Nov 3, 2014
b99588e
Handle recurrence rrules if present.
bigpresh Nov 3, 2014
a6793b0
Add a Changes file.
bigpresh Nov 3, 2014
b5f6a1f
Tweak start time in this test data
bigpresh Nov 3, 2014
2f87b50
chmod +x bin/ical-to-gcal
bigpresh Nov 5, 2014
063577f
Expected result for recurring.ical
bigpresh Nov 5, 2014
9d6f629
Remove left-over debuggery
bigpresh Nov 5, 2014
cdfb9d9
More extraneous debug info removed
bigpresh Nov 5, 2014
7da010a
And more debuggery to go
bigpresh Nov 5, 2014
46e2af1
Replace recurring.ical test data
bigpresh Nov 6, 2014
1d957b5
Bodgy-hack: force Test::Differences to behave.
bigpresh Nov 6, 2014
6bb691c
Update expectation for test1.ical
bigpresh Nov 6, 2014
76c9c07
Don't change time when setting timezone.
bigpresh Nov 6, 2014
e80d75f
no -T on shebang
bigpresh Nov 9, 2014
268a4e5
Set timezone in base object at creation.
bigpresh Nov 9, 2014
ad380a7
Revert "Bodgy-hack: force Test::Differences to behave."
bigpresh Nov 27, 2014
a62e9b4
Add tests to MANIFEST
bigpresh Nov 27, 2014
0c90e5f
New test - parse another iCal without clearing object.
bigpresh Dec 4, 2014
0e0e41f
Add expected output from allday.ical
bigpresh Dec 4, 2014
1ba78a1
fix typo in comment
bigpresh Dec 4, 2014
a09eb19
Another comment typo
bigpresh Dec 4, 2014
b686718
Test with a non-DST-timezone.
bigpresh Dec 4, 2014
0c73ad6
Missed updating this datetime from last commit
bigpresh Dec 4, 2014
76612b7
Test titles to make output a bit clearer
bigpresh Dec 4, 2014
0c02c91
Set the all-day flag if start & end are 00:00:00
bigpresh Dec 4, 2014
bf47f4a
Expect the all_day flag, now it works :)
bigpresh Dec 4, 2014
7f0386a
Add DateTime::Format::DateParse as a prereq.
bigpresh Dec 4, 2014
ad40926
Compare event content.
bigpresh Dec 4, 2014
0085641
Doc improvements
bigpresh Dec 4, 2014
f846c1f
Add a notice that this won't work and how to fix.
bigpresh Feb 27, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Revision history for App-GCalToICal

0.01 2014-11-??
[ NEAR RE-WRITE ]
- Turned old ical-to-gcal script into a CPAN distribution
- Switched from Parser::iCal to Data::ICal
- Added recurring events support
- Support multi-day events properly
- Refactored to provide testability
- Added tests


10 changes: 10 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Changes
lib/App/ICalToGCal.pm
Makefile.PL
MANIFEST
README
bin/ical-to-gcal
t/00-mock.t
t/ical-data/allday.ical
t/ical-data/recurring2.ical
t/ical-data/test1.ical
35 changes: 35 additions & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
use 5.006;
use strict;
use warnings FATAL => 'all';
use ExtUtils::MakeMaker;

WriteMakefile(
NAME => 'App::ICalToGCal',
AUTHOR => q{David Precious <davidp@preshweb.co.uk>},
VERSION_FROM => 'lib/App/ICalToGCal.pm',
ABSTRACT_FROM => 'lib/App/ICalToGCal.pm',
LICENSE => 'Artistic_2_0',
PL_FILES => {},
EXE_FILES => [ 'bin/ical-to-gcal' ],
MIN_PERL_VERSION => 5.010,
CONFIGURE_REQUIRES => {
'ExtUtils::MakeMaker' => 0,
},
BUILD_REQUIRES => {
'Test::MockObject' => 0,
'Test::More' => 0,
},
PREREQ_PM => {
'Net::Google::Calendar' => 0,
'Net::Netrc' => 0,
'LWP::UserAgent' => 0,
'Data::ICal' => 0,
'Date::ICal::Duration' => 0,
'DateTime' => 0,
'DateTime::Format::DateParse' => 0,
'Digest::MD5' => 0,
'Scalar::Util' => 0,
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'App-ICalToGCal-*' },
);
13 changes: 13 additions & 0 deletions README.pod
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
=head1 ical-to-google-calendar


=head1 NOTICE

At present, this script WILL NOT WORK, as it relies on the CPAN module
L<Net::Google::Calendar|https://metacpan.org/pod/Net::Google::Calendar> which
(at time of writing) uses an older API version which Google no longer support.

To get this working, either Net::Google::Calendar needs updating to use their
newer API, or this script needs to be switched to using
L<Net::Google::CalendarV3|https://metacpan.org/pod/Net::Google::CalendarV3> but
I don't think it's a straightforward drop-in replacement, and I haven't had time
to do it (I no longer use this script myself. However, pull requests welcome!)

=head1 DESCRIPTION

A simple Perl script to parse an iCal-format (.ics) file, and update a Google
Expand Down
41 changes: 41 additions & 0 deletions bin/ical-to-gcal
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env perl

# ical-to-gcal
# A quick script to fetch and parse an iCal/vcal feed, and update a named Google
# Calendar.
#
# See the README in the repo for more details on why and how to use it:
# https://github.com/bigpresh/ical-to-google-calendar
#
# David Precious <davidp@preshweb.co.uk>

use strict;
use App::ICalToGCal;
use Getopt::Long;

my ($calendar, $ical_url);
Getopt::Long::GetOptions(
"calendar|c=s" => \$calendar,
"ical_url|ical|i=s" => \$ical_url,
) or die "Failed to parse options";


if (!$ical_url) {
die "An iCal URL must be provided (--ical_url=....)";
}
if (!$calendar) {
die "You must specify the calendar name (--calendar=...)";
}


my $gcal = App::ICalToGCal->select_google_calendar($calendar);

my $ical = App::ICalToGCal->fetch_ical($ical_url);

App::ICalToGCal->update_google_calendar(
$gcal,
$ical,
App::ICalToGCal->hash_ical_url($ical_url),
);


187 changes: 0 additions & 187 deletions ical-to-gcal

This file was deleted.

Loading