I’m going to plug your routine in and see if it gets me what I’m looking for. It might help me understand how the data gets handled a little bit. That is where I’m really lost at the moment. Once I know how to get the data I want, then I can start working on how to handle and process it. Programming Tasker seems a lot like programming in basic with a bunch of built in routines that you don’t have to write. I’m rusty as hell on programming but I’ll figure it out sooner or later. Leaning real hard on other people’s stuff to learn how some of this works…
I'm gutting another task I got from pocketables but it's not processing the variables correctly after the first or second task. Understanding a bit better how variable split functions but stumped by the appearance that it won't function reliably. Will post what I have later so you can see if you can figure out if I did something wrong.
The routine I put together last night that worked gave me the same result today. I got all the event names clean but the comment data went south after the first few entries. Need to export it and attach but not at my computer. Flipping the date around should be easy enough. I have a routine I stole from another script that breaks it down to month, day, year so putting it back together in one variable is no problem. Tasker has a built in date variable to compare it to. Part of my goal in this is reminding certain friends of certain event by text on the day of the event. For now, these people will be hard coded to keep things simple. Pulling 6 or 8 events gets several days events most of the time so compare on the date will come into play later. Right now I'm still stuck on getting clean data.
Are you trying to get just the current day’s events? I was just grabbing the next 8 (at the moment) and was just going to parse through and only use the current day’s events. Seemed like less work to me. Your way would definitely catch all of the events on the off chance I had more scheduled than I built my routine for but I’m not that busy a guy. Anyhow, I’ll be looking at your idea now too as it very well might be more practical.
From: tas...@googlegroups.com [mailto:tas...@googlegroups.com] On Behalf Of Mike Maynard
Sent: Sunday, August 12, 2012 12:32 PM
To: tas...@googlegroups.com
Subject: Re: Processing Google Calendar Data
I will give it a shot!
I am only after current day. Which is easily chosen via the api.
I’m glad you figured that out. I’ve been beating my head wondering why it keeps failing to parse the data properly and after you said something it hit me that that was what was happening. It hit a record with no comment and aborted. Added a routine to send myself a text when it was done and tested and sure enough, no text…. As best I can tell, Tasker can handle as many events as it has memory for variables. I hate to think I’m going to have to have a separate task process each event but I guess if there’s no way to proceed after an empty record then at least when the task ended and dropped back to the calling task (if it works that way), then that task would continue to the next event. I lost myself on that idea so if it seems out there, it might be.
From: tas...@googlegroups.com [mailto:tas...@googlegroups.com] On Behalf Of easiuser
Sent: Sunday, August 12, 2012 4:00 PM
To: tas...@googlegroups.com
Cc: mmay...@rochester.rr.com
Subject: Re: Processing Google Calendar Data
Also routine appears to abort if there is an empty where or content field. Working on a solution.
Nice work! I’m not sure how to handle arrays in Tasker as of yet but your work is definitely going to get a bit of study. I was reading the Google calendar data based of someone else’s script and had no idea that the api was that flexible. Reading today’s events and then processing them, would be easy enough and the api call could be changed to get tomorrows as well without having to specify a set number. Some things I’d like to have a days notice on. It would be nice to be able to pull the comment data but that could be done without if we can’t find a way around the script aborting when it’s empty.
Will give this a look see when I get back from running a few errands. I figured out yesterday how to keep it from choking on empty variables. Don’t know if you saw that but it might have helped you. I’m interested to see if your work went the same direction that mine did but I’ve gotta run. I’ll get back here later though….
Already had beginner mode off just didn't know about the arrow.... Now I just have to create a profile to run it...
Just added you to my chat list but I'm not available very often for chat. Mostly during the day.
What are the Param1 and Param2 items for in the first line where is performs the clear arrays task? Couldn’t you have just cleared the arrays as part of the GetAgenda task or did you make it a separate task for a reason? I’m curious, definitely not criticizing. Your work is very nice and I’m hoping to reverse engineer it and understand why things work. Still way to new to Tasker for some things….
From: tas...@googlegroups.com [mailto:tas...@googlegroups.com] On Behalf Of easiuser
Sent: Monday, August 13, 2012 1:12 AM
To: tas...@googlegroups.com
Cc: mmay...@rochester.rr.com
I had no idea that my little request for a bit of info was going to take on a life of its own. One thing’s for sure, by the time I get done looking at everyone else’s work and reading their input, I’ll have a much better understanding of how Tasker handles some things. Arrays are the focus of my study now as I’ve figured out how to split variables and clean up data. I also figured out how to do a bit of error checking in the process. This little project has become a major learning experience…
It just happened to come along on the tail of a thread I had started about my project needs...
I appreciate all the help, and it certainly has been a learning experience for me as well!
True. It could be downloaded and processed at 7 and still get all the days data… J Just figured processing it while I’m still in bed would mean that the processing time would mean nothing to me….. If you’re going to get into scenes, give me time to digest what I have as I have no idea what scenes are all about….
No problems either way, I'm just learning what I can. Still working on digesting the array information. Got a little sidetracked or I'd already have it plotted out.
Did you guys notice the date not working properly? I had to add a check that adds a 0 in front of the month and day to fervor to work properly with google.
Seemed to be working ok… Where did you have to add a check?
From: tas...@googlegroups.com [mailto:tas...@googlegroups.com] On Behalf Of Mike Maynard
Sent: Tuesday, August 14, 2012 3:05 PM
To: tas...@googlegroups.com
Subject: Re: Processing Google Calendar Data
Did you guys notice the date not working properly? I had to add a check that adds a 0 in front of the month and day to fervor to work properly with google.
Before that query variable is built, I check DATE1 and DATE2 separately with an idea statement, if they are less than 10, I place a 0 in front of them.
Oh, I thought the system date variable came already formatted with the leading zero. I looked at it but seeing as calling the API in the manner was not my idea at all, I didn’t look too hard at it. Would you believe I’m still trying to wrap my brain around the variable use in this script? I’m not having issues with the array at all, it’s a few of the local variables I’m still trying to understand. I’m pretty sure I understand the way they were used, maybe I’m just still wondering how someone would come up with that idea. Been out of programming WAY too long….
From: tas...@googlegroups.com [mailto:tas...@googlegroups.com] On Behalf Of Mike Maynard
Sent: Tuesday, August 14, 2012 3:17 PM
To: tas...@googlegroups.com
Subject: RE: Processing Google Calendar Data
Before that query variable is built, I check DATE1 and DATE2 separately with an idea statement, if they are less than 10, I place a 0 in front of them.
Ok, screw it. I’m going to ask… Where did the variables %item, %item2 come from??? I see where last is defined but the other two are escaping me. Is this some neat built in Tasker routine? Please explain how it works or point me to a reference so I can read it for myself.
Thanks!!!
From: tas...@googlegroups.com [mailto:tas...@googlegroups.com] On Behalf Of Mike Maynard
Sent: Tuesday, August 14, 2012 3:17 PM
To: tas...@googlegroups.com
Subject: RE: Processing Google Calendar Data
Before that query variable is built, I check DATE1 and DATE2 separately with an idea statement, if they are less than 10, I place a 0 in front of them.
I wrote this to process the dates in the array to a more friendly format. Don't know if I could have made it smaller but I suspect it could be. Going to incorporate it all into one routine when all the bugs are out and I figure out how I want to do it..
Test (40)
A1: Variable Set [ Name:%item To:%cntEvents Do Maths:Off Append:Off ]
<Date Loop>
A2: Variable Set [ Name:%start To:%EventStart(%cntEvents) Do Maths:Off Append:Off ]
A3: Variable Split [ Name:%start Splitter:T Delete Base:Off ]
A4: Variable Split [ Name:%start1 Splitter:- Delete Base:Off ]
A5: Variable Split [ Name:%start2 Splitter:: Delete Base:Off ]
A6: Variable Set [ Name:%start25 To:am Do Maths:Off Append:Off ]
A7: Variable Set [ Name:%start25 To:pm Do Maths:Off Append:Off ] If [ %start21 > 11 ]
A8: Variable Set [ Name:%start21 To:%start21*1 Do Maths:On Append:Off ]
A9: Variable Set [ Name:%start21 To:%start21-12 Do Maths:On Append:Off ] If [ %start21 > 12 ]
A10: Variable Set [ Name:%start21 To:12 Do Maths:Off Append:Off ] If [ %start21 ~ 0 ]
A11: Variable Set [ Name:%start To:%start12/%start13 at %start21:%start22%start25. Do Maths:Off Append:Off ]
A12: Array Push [ Name:%EventStart Position:1 Value:%start Fill Spaces:Off ]
A13: Variable Set [ Name:%end To:%EventEnd(%cntEvents) Do Maths:Off Append:Off ]
A14: Variable Split [ Name:%end Splitter:T Delete Base:Off ]
A15: Variable Split [ Name:%end1 Splitter:- Delete Base:Off ]
A16: Variable Split [ Name:%end2 Splitter:: Delete Base:Off ]
A17: Variable Set [ Name:%end25 To:am Do Maths:Off Append:Off ]
A18: Variable Set [ Name:%end25 To:pm Do Maths:Off Append:Off ] If [ %end21 > 11 ]
A19: Variable Set [ Name:%end21 To:%end21*1 Do Maths:On Append:Off ]
A20: Variable Set [ Name:%end21 To:%end21-12 Do Maths:On Append:Off ] If [ %end21 > 12 ]
A21: Variable Set [ Name:%end21 To:12 Do Maths:Off Append:Off ] If [ %end21 ~ 0 ]
A22: Variable Set [ Name:%end To:%end12/%end13 at %end21:%end22%end25. Do Maths:Off Append:Off ]
A23: Array Push [ Name:%EventEnd Position:1 Value:%end Fill Spaces:Off ]
A24: Variable Subtract [ Name:%item Value:1 ]
A25: Goto [ Type:Action Label Number:1 Label:Date Loop ] If [ %item > 0 ]
A26: Perform Task [ Name:Process Events Stop:Off Priority:5 Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: ]
Is that what this does?
A15: For [ Variable:%item Items:%Event(2:%last) ]
I have tested it with no reminder set and it still downloaded the next day event. No real big deal here as I can either ignore it or flag it as an all day event for tomorrow and deal with it as such. I guess I’ll wrap all of what I have now into one task and use local variables only and see where that gets me. Harder to debug that way but I can set other variables temporarily to see what I need to see. The variables that are left over don’t appear to be part of the array (I don’t think you can see the array in the variables list) but I could be wrong.
From: tas...@googlegroups.com [mailto:tas...@googlegroups.com] On Behalf Of easiuser
Sent: Thursday, August 16, 2012 10:34 AM
To: tas...@googlegroups.com
Subject: Re: Processing Google Calendar Data
Just noticed the same thing. It happens when there is an all day event for the next day. Google may be including it due to a reminder being set which would happen just before midnight. Also the data downloaded is structured a bit different than a normal appointment (including no time value, just a date) Will have to debug and repost. Also looks like the appointments are returned in the order created and not sequentially so I will have to do some additional sorting before writing the output. I'll try to get to it over the weekend.
I have seen many instances of downloading the calendar data to a text file and parsing it from there so I'm not totally lost, however I don't understand how the data is being parsed and looking at the data from several tasks I've downloaded doesn't help much. What I want to do is look at my calendar entries each morning and then process tasks by the days events. I only need it to run once each day but I want it to handle all of the days events. My task can loop and handle each entry one at a time as far as I'm concerned. I see the calendar entry state but I don't think this will be very helpful in this. If I'm wrong, please educate me on the use of the calendar entry state. New to Tasker but I'm learning, even if so far it's mostly by tearing apart something that someone else has done and reverse engineering it. Thanks ahead of time for any help I get...
I’ll give it a run in the next few days and let you know. I’ve got it to do pretty much what I wanted but I will learn from your project and probably steal a few things while I’m at it. Always looking for new ideas and methods…
From: tas...@googlegroups.com [mailto:tas...@googlegroups.com] On Behalf Of easiuser
Sent: Saturday, August 25, 2012 9:05 PM
To: tas...@googlegroups.com
Subject: Re: Processing Google Calendar Data
OK. I got it fairly functional. I use it to get my personal and work agenda for the next 2 days and have it read over my car's BT during my commute. I would be interested if it works for you or anyone else. This may all be for nought if the future calender event action ever gets implemented in Tasker. It's on the extensive todo list. If it works for others, I might post it on the Tasker Wiki.
On Thursday, August 9, 2012 10:30:46 PM UTC-5, Michael Yeager wrote:
I ran into a problem with this but it wasn't with tasker, it was actually the first line.
Agenda (117)
A1: HTTP Get [ Server:Port:https://www.google.com/calendar/feeds/xxx%40gmail.com/private-xxx/full?start-min=2012-08-11T00:00:00&start-max=2012-08-11T23:59:59 Path: Attributes: Cookies: Timeout:67 Mime Type: Output File:agenda.txt ]
the Time(T00:00:00 and T23:59:59) is GMT, which means you have to adjust for the timezone your calendar is in. For example mine is Eastern Standard or GMT -5:00 so I had to amend the times with (.000-5:00) so now they read (T00:00:00.000-5:00 and T23:59:59.000-5:00).It took me a while to figure this out, just thought it may help someone else.
On Sunday, August 12, 2012 1:59:19 AM UTC-4, easiuser wrote:
Mike, You prompted me to parse my own data. When ran, your event data should be in their respective array variables. I don't know how many events Tasker can handle, but I hope it works for you.
Agenda (117)
A1: HTTP Get [ Server:Port:https://www.google.com/calendar/feeds/xxx%40gmail.com/private-xxx/full?start-min=2012-08-11T00:00:00&start-max=2012-08-11T23:59:59 Path: Attributes: Cookies: Timeout:67 Mime Type: Output File:agenda.txt ]
A2: Read File [ File:agenda.txt To Var:%myAppt ]
A3: Variable Split [ Name:%myAppt Splitter:<openSearch:totalResults> Delete Base:Off ]
A4: Variable Split [ Name:%myAppt2 Splitter:</openSearch:totalResults> Delete Base:Off ]
<%cntEvents is the number of events returned>
A5: Variable Set [ Name:%cntEvents To:%myAppt21 Do Maths:Off Append:Off ]
A6: Variable Set [ Name:%Event To:%myAppt22 Do Maths:Off Append:Off ]
<Splits file into %Events2,3,4,...>
A7: Variable Split [ Name:%Event Splitter:#kind Delete Base:Off ]
A8: Variable Set [ Name:%last To:%cntEvents+1 Do Maths:On Append:Off ]
Still around. I can send you my routine that pulls all events for the current day if you like. It's not been improved in quite some time but it works. At least it will give you a working start.
--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/eO1OYspNCuA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/groups/opt_out.
Already posted it.... Can email the xml if needed. Kinda long to plug in one line at a time.....
Thanks for the link I will try this method for getting the information.
I'm going to look at it as well. My code is old, crude and limited in its abilities. It does the job I wanted it to do at the time but I have no doubt it could have been better.
I'm surprised no one has come up with a taker app to do this
I guess your right I'm use to be rooted