Skip to content

andesco/blocker.day

Repository files navigation

Blocker.day

Blocker.day helps you block time randomly and quickly, with a .ics calendar feed set to your desired availability.

Using random (but deterministic) blocks of unavailable time, you can quickly populate an otherwise sparse calendar app, including Apple or Google; or randomly limit availability in a scheduling app, including Cal.com and SavvyCal.

For example, Blocker.day in Apple Calendar, set to 1 hour blocks and 50% probability:
blocker.day/calendar.ics?h=1&p=0.50

Blocker.day in Apple Calendar with 1 hour blocks and 50% probability

Features

  • generate a unique .ics calendar feed of unavailable time
  • deterministic pseudo-random availability based on your seed value, probability, and time block
  • time blocks begin each day at midnight (00:00) in the timezone specified

Add or Subscribe: blocker.day/calendar

Add or subscribe to Blocker.day in your calendar or scheduling app. You can include the option .ics file extension and set DAYS, HOURS, and PROBABILITY in the URL query:

https://blocker.day/calendar
https://blocker.day/calendar.ics
https://blocker.day/calendar.ics?d=7&h=4&p=0.35
https://blocker.day/calendar.ics?days=7&hours=4&probability=0.35

Deploy to Cloudflare

Blocker.day is a Cloudflare Worker (serverless function) that generates a unique .ics calendar feeds.

Deploy your own Cloudflare Worker to change additional settings (using environment variables) including NAME, SEED, SEED_VIA_URL, and TIMEZONE,

Option 1: Deploy to Cloudflare

Deploy to Cloudflare

Option 2: Manual Deployment

  1. Clone this repo:
git clone https://github.com/andesco/blocker.day.git
cd blocker.day
  1. Customize default variables in wrangler.toml as needed. Example:
DAYS = "21"
HOURS = "4"
PROBABILITY = "0.25"
TIMEZONE = "America/Vancouver"
  1. Install Cloudflare’s Wrangler CLI, login, and deploy:
npm install -g wrangler
wrangler login
wrangler deploy

Usage

Add or subscribe to a calendar using your worker subdomain, a custom subdomain, or blocker.day:

https://appname.username.workers.dev/calendar.ics

https://subdomain.personal.com/calenda.ics

https://blocker.day/calendar.ics

Calendar feeds generate consistent blocks of time based on the seed being used. To get a new set of randomized (but deterministic) blocks of time, update your Cloudflare Worker environment variables:

  • change the default value of SEED; or
  • set SEED_VIA_URL to true and set an optional per-calendar SEED in the URL query: https://subdomain.personal.com/calendar?seed=random-seed-value

Environment Variables

Variable Description Default
DAYS number of days: 1–21 14
HOURS hours in each block of time:
0.5, 1, 2, 3, 4, 6, 8, 12, 24
3
TIMEZONE IANA timezone identifier America/Toronto
NAME calendar/event name displayed in apps Blocker.day
PROBABILITY probability of a time block: 0.00–1.00 0.50
REDIRECT redirects hostname root andesco/blocker.day
SEED default seed value default-seed-value
SEED_VIA_URL enable setting SEED via URL query:
true, false
false

URL Query Parameters

Variable Description
days
d
number of days:
1–21
hours
h
hours in each block of time:
0.5, 1, 2, 3, 4, 6, 8, 12, 24
probability
p
probability of a time block:
0.00–1.00
seed calendar-specific seed value if SEED_VIA_URL is true

About

Blocker.day helps you block time randomly and quickly, with a .ics calendar feed set to your desired availability. Blocker.day is a Cloudflare Worker (serverless function). Deploy to Cloudflare to change advanced settings.

Topics

Resources

License

Stars

Watchers

Forks

Contributors