I installed gcalcli on my Windows 10 machine to check. I don’t see a header row. What is the user function definition you’re using in your Templater configuration?

Here’s what I found to work for me:

powershell (C:/Users/munes/AppData/Local/Programs/Python/Python39/Scripts/gcalcli --nocolor agenda --details all --tsv --nodeclined '%from%' '%to%')

yes that is the filter i tried

Ok. I don’t know why but I think I got it fixed.

When I tried this originally from your script I had difficulty returning the location so I tweaked it and I was able to get the results I wanted - except for the additional header.

So this time I used your original template script but i had to add “id: props[0]” to the return and renumber the other items. I noticed the results included that extra value when i tested the powershell call to gcalcli.

<%*
function parseAgendaTsv(agenda) {
return agenda.split("\n").map(event => {
let props = event.split("\t")
// gcalcli handlers
return ({id: props[0],
startDate: props[1],
startTime: props[2],
endDate: props[3],
endTime: props[4],
calendarUrl: props[5],
notSure5: props[6],
conferenceType: props[7],
conferenceUrl: props[8],
title: props[9],
location: props[10],
description: props[11],
calendar: props[12],
meetingUrlOrLocation: props[6] == “video” ? props[7] : props[9],
raw: event,
})
})
}

i did need to filter the agenda for my calendar to remove the header.
agenda = agenda.filter((e,i) => e.calendar == “myemail@gmail.com” )

1 Like

Yay, finally got some time to hack on the gcalcli-less solution: muness/obsidian-ics: Generate Daily Planner from one or more ical feeds (github.com)

It only supports a single ics right now, and presumes a Daily Planner format.

  1. from Google Calendar, look for the calendar in the left sidebar click the vertical … menu, Settings and Sharing, Integrate calendar, Copy the Secret address in iCal format
  2. enter that URL into settings
  3. go to a daily note, use the ICS: Import events command
4 Likes

I copied main, manifest, and styles into the plugins folder, but the plugin will not activate. What am I missing? Does it need a data.json file?

I think it’s main.ts, right? You need to compile to javascript first. So you will probably need tsconfig.json. Also I think he imports some typescript from a folder as well. So you will probably just want to download the entire repository, install dependencies with “npm install” and compile with “npm run build”. Not sure though. Can’t really look into it that much right now.

@muness you rock!
If you can get this to do more than one ics, I will buy you a case… of coffees!

1 Like

I ran “npm run build” and it created main.js, but I really don’t know what to do from there. Looks like I’ll have to wait for @muness to publish it…

While I figure out how to release this (am new to obsidian plugins, apologies for the delay), the easiest way to get it working for now is to use obsidian-tools/packages/obsidian-plugin-cli at main · obsidian-tools/obsidian-tools (github.com) to build it and install it into your vault.

  1. Clone the repo & cd into it
  2. Install the plugin tools: npm install -g obsidian-plugin-cli
  3. npm dev . which will build the plugin and ask you which vault to install it into.

I am hoping to have a release shortly, just having trouble with including the npm dependencies in the build when I build the plugin using GitHub Actions.

4 Likes

Today I fixed the recurring event detection issues, added multiple calendar support, and the ability to name calendars. :slight_smile: Fingers crossed I can figure out the release issues tomorrow, then I can work on template support.

2 Likes

I have a working build, yay! Release 0.9.7 · muness/obsidian-ics (github.com)

Please give it a whirl and report back. Thank you!

13 Likes

@muness confirming the plug-in works great. This is exactly what I was looking for (and checking if someone has worked on something like this before hacking something myself). Thanks a lot for working on this and sharing :raised_hands:

2 Likes

Thank you so much Muness. The plugin works great.
I am looking forward to more customizing options, but just the “basic” functionality you integrated now is already going to be part of my workflow. I like how you integrated it seamlessly with the periodic notes and calendar plugin.

I can already see how this is going to help me do time-blocking.

  1. time-block in my google agenda for the week
  2. create the daily notes in obsidian
  3. import for each day the calendar
  4. add the tasks I want to do under each list
  5. Each day, link the daily note to the “day planner” timeline.

The way I use it is that I set some emojies for the various calendars I have. This way, the list looks clean and emphasizes the name of the event.


image

3 Likes

Thank you for pointing out such a useful tool! I actually found a different use case for this: Getting the zoom-url of your next meeting!

This line gets the “Location” property of the next event in my work calendar. (I tend to save the Zoom-URL in the location field and not the URL field – just change ‘location’ to ‘url’ if you use the URL field)

gcalcli --calendar Academia agenda --details location "`date '+%Y-%m-%d %H:%M'`" "`date '+%Y-%m-%d 23:59'`" | grep "Location" | cut -d ":" -f2,3 | cut -c 2- | head -n 1

Now why stop here? I’d like to open the zoom link directly. open comes to mind, but when specifying that the link should be opened with zoom, I can even skip the extra step of my default browser opening the Zoom URL first. So we modify the thing a tiny bit, and get the following script, which will automatically launch the zoom meeting of the next appointment I have :smiley:

now=`date '+%Y-%m-%d %H:%M'`
endOfToday=`date '+%Y-%m-%d 23:59'`
calendar="workCalendar"
zoomURL=`gcalcli --calendar $calendar agenda --details location "$now" "$endOfToday" | grep "zoom.us" | cut -d ":" -f2,3 | cut -c 2- | head -n 1`
open -a "zoom.us" "$zoomURL"

Well, I am gonna put this into an alias and into my launcher app. I know this isn’t strictly an Obsidian-related use case, but I am sure this will nevertheless be useful to some people.

1 Like

This is amazing, you’ve saved me so much time. How can I show my appreciation? I can’t find a link in your github or blog that lets me buy you coffee or anything

Can this work for shared calendars that I have setup in google?
I added the additional calendars, and the plugin stopped working. I removed them, and it works for the main calendar again

Hi @muness , I tried it. When I went to activate “ICS”, it says “failed to load plug-in”.

Steps I took to get the above error:
I downloaded the release, unzipped your file and saved all the files from that to the ics folder within the plugins folder, as instructed in your readme. And then restarted the Obsidian app. I searched and found ICS plugin. Then I activated it. And I got the error.

I am using Windows 10 on a PC.

Hey @muness, the Plugin works wonderful. Helps me so much. I am not into coding, but it would be also of great help if one could import the All-Day-Events from google calendar (besides the daily Agenda), like an upcoming section for the rest of the week in your daily notes. Smart ass writing that without having the skills to code it :slight_smile: Big thanks again!

1 Like

I think I saw All-Day-Events in the iCal.

I’ll try to take a look at this and the failed to load plug-in error some folks are reporting over the holidays and cut another release.

Would you say the plugin is working well enough that I should submit it to the official plugins list so that folks can install it directly from inside Obsidian?

1 Like

I only registered to tell you to do so! This plug-in works better than some of the “official” community plugins I tried and deserves to get some attention.

I would love to see customization options so that different calendars are being imported in different formats. For example I use one calendar for time-blocking and another for automated time-recording. I left your plugin unchanged for the first one (the formatting as tasks makes sense there) but hacked it (poorly, I’m afraid) to import the other calendar as a log (including details such as the calendar entry’s description.

Oh, and before you do submit it to the community plugins: Get that coffee button going as nick_s suggested.

Keep up the good work! :+1:

1 Like