# Script for scheduling break across all goals?

**URL:** <https://forum.beeminder.com/t/script-for-scheduling-break-across-all-goals/6079>\
**Category:** Tech\
**Created:** [December 10, 2019, 10:52pm UTC](https://forum.beeminder.com/t/script-for-scheduling-break-across-all-goals/6079 "2019-12-10T22:52:35Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![beeminder\_user](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@beeminder\_user](https://forum.beeminder.com/u/beeminder_user)\
**Post date:** [December 28, 2019, 4:46pm UTC](https://forum.beeminder.com/t/script-for-scheduling-break-across-all-goals/6079/3 "2019-12-28T16:46:14Z")

</div>

[GitHub - matkoniecz/beeminder\_break](https://github.com/matkoniecz/beeminder_break) has repo with the first usable version. For now it only lists goals that need to be modified.

Now the next step, an automatic road editing.

[Beeminder API Reference](http://api.beeminder.com/#attributes-2) has

> road (array): Array of tuples that can be used to construct the Yellow Brick Road. This field is also known as the road matrix. Each tuple specifies 2 out of 3 of [time, goal, rate]. To construct the road, start with a known starting point (time, value) and then each row of the road matrix specifies 2 out of 3 of {t,v,r} which gives the segment ending at time t. You can walk forward filling in the missing 1-out-of-3 from the (time, value) in the previous row.

“Yellow Brick Road” is unclear to me, I assume for now that it is a line that divides “derail” and “no derail” graph areas. Not sure about the input format, but [Arbitrary break scheduling script](https://forum.beeminder.com/t/arbitrary-break-scheduling-script/5331) should be helpful here.

I think that I will assume for now that time and rate is used, set rate to 0 at start of the break and restore value later.

Things to get:

- get current goal rate
- detect planned date changes between now and break start, if any - get last goal rate before break
- detect planned date changes between break start and break end, crash loudly in case of detecting them (ends inclusive, to avoid scheduling break multiple times - not sure what would happen)

And based on that output planned break schedule. For now without any API calls modifying goals.

Maybe I will write also code making some trivial edit to a goal.

---

_[View the full topic](https://forum.beeminder.com/t/script-for-scheduling-break-across-all-goals/6079)._
