Site icon Pocketables

Tasker PAI series: Google Calendar multi-event fetcher

Screenshot 2013 05 21 19 00 49 - for some reason we don't have an alt tag here

Disclaimer: The Tasker PAI series is a series of Tasker articles “Provided As Is“. They are marked as such because there’s an above average likelihood that something will break very badly when used by someone else, for whatever reason, and I don’t have the time to fix it for everyone that happens to. Read more here. Articles in this series are only published so that those who know what to do with it have the chance, but questions to these articles will be ignored. 

A lot of people seem to be trying to use Google Calendar data in Tasker, and keep finding an old article of mine that was never meant to show how to do anything other than the specific thing in it, namely fetch the next event.

To try to make something a bit more universal, I sat down and created what’s best described as a Google Calendar plug-in for Tasker. If you feed it your private URL for a calendar, it will chop it up into tiny pieces and sort data into arrays that you can access.

This task is something I created fairly quickly, tested very briefly, and don’t plan on spending more time on. I’m 98% certain that there are better ways of doing this, but it’s not something I’m going to spend time on figuring out, because I have no use for it. I’ve successfully gotten it to work with both all day and more specific tasks (that’s what those If groups are for), but it will probably break for the weirdest of reasons, like time zones, Google Calendar format, device date settings, or who knows what. As such, I will only explain how it’s supposed to work, and beyond that, I can’t help you:

When run, the task will generate 7 local variables for each event. It does so by creating 7 separate arrays. Each array will have one element (variable) for each event you fetch. The arrays are:

This means that if you have it fetch 3 events, you will have %caltitle1, %caltitle2, %caltitle3, and similarly for all the other arrays. The information for event 1 will be spread across %caltitle1, %calstartdate1, %calenddate1, and so on, and similarly for event 2, 3, etc. Event 200 will have its data in %caltitle200, %calstartdate200, and so on, if you try to fetch that many.

This uses local variables because otherwise it would be too slow. Transfer the data you actually need in intelligent ways if you run this externally.

Download: Calendar_Sorter.tsk.xml

 

Pocketables does not accept targeted advertising, phony guest posts, paid reviews, etc. Help us keep this way with support on Patreon!
Exit mobile version