TimeTree-Exporter icon indicating copy to clipboard operation
TimeTree-Exporter copied to clipboard

Support Public Calendars' Event

Open AndCycle opened this issue 1 year ago • 6 comments

thanks for the project that saves me some time to work on personal tool to export timetree data to google calendar,

as I trying to export data from public TimeTree calendar the data doesn't provide any alerts or recurrences

api endpoint https://timetreeapp.com/api/v2/public_calendars/{calendar_id}/public_events

  File "/home/andcycle/.local/share/mise/installs/python/3.12.7/lib/python3.12/site-packages/timetree_exporter/formatter.py", line 208, in to_ical
    for alarm in self.alarms:
                 ^^^^^^^^^^^
  File "/home/andcycle/.local/share/mise/installs/python/3.12.7/lib/python3.12/site-packages/timetree_exporter/formatter.py", line 132, in alarms
    for alert in self.time_tree_event.alerts:
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable

AndCycle avatar Nov 12 '24 09:11 AndCycle

@AndCycle Could you test if the pr works for public calendars?

eoleedi avatar Nov 13 '24 02:11 eoleedi

@eoleedi looks good to me, thanks, there is some other attribute need some work, public event doesn't have uuid, I don't know filling it with id value is a proper solution or not

AndCycle avatar Nov 13 '24 07:11 AndCycle

https://github.com/eoleedi/TimeTree-Exporter/blob/1264832ba7fd512bb3071556bf70d35b85477775/timetree_exporter/formatter.py#L193

as I looking into the RFC standard https://datatracker.ietf.org/doc/html/rfc5545#section-3.8.7.3 this should be last-modified

AndCycle avatar Nov 13 '24 16:11 AndCycle

https://github.com/eoleedi/TimeTree-Exporter/blob/1264832ba7fd512bb3071556bf70d35b85477775/timetree_exporter/formatter.py#L193

as I looking into the RFC standard https://datatracker.ietf.org/doc/html/rfc5545#section-3.8.7.3 this should be last-modified

Indeed!

eoleedi avatar Nov 15 '24 00:11 eoleedi

@AndCycle I believe the events in the public calendar are in API v2 format. We should define different TimeTreeEvent Classes for different calendar and API versions.

eoleedi avatar Nov 18 '24 08:11 eoleedi

indeed, should have different class for them, thanks for lookup into this

AndCycle avatar Nov 18 '24 08:11 AndCycle