npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

schcal

v3.0.5

Published

schtasks-calendar auto add events to windows schtasks from google calendar

Downloads

12

Readme

schtasks-calendar (or schcal)

Synchronizes (or clones) Google Calendar events containing a markdown link to Windows Task Scheduler to automatically open the link on time on your PC.

Get Started

1. Add events to Google Calendar (let's say, in the next few days).

Type into the title field in the following format:

  • [ ...taskname ]( ...link )
  • [ ...taskname ]( ...local_application_path )

Example:

  • [ view schtasks-calendar ]( https://github.com/snomiao/schcal )

2. Then go to the settings for the particular calendar (in the hamburgur menu on the left), or go to Settings for my calendars section (in the main settings) for the particular calendar to be exported.

google-calendar-setting-button.png

Scroll down and copy the private ics url

And you should get the ics url https://calendar.google.com/calendar/ical/xxxxxxxxxxxxxxxxxxx/private-cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/basic.ics Copy and save it for step 3.

3. Then run using the command parameters.

npx schcal YOUR_ICS_URL

Example:

npx schcal https://calendar.google.com/calendar/ical/xxxxxxxxxxxxxxxxxxx/private-cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/basic.ics

You should see this

4. Check your schtasks

Press Win + R and type taskschd.msc to open Windows Task Scheduler

The task SSAC-0820-0530-view schtasks-calendar-XXXXXX corresponds to the event you just added to Google Calendar and the link contained will be opened on time.

5. Configure schtasks auto update (daily or whenever)

If you want to keep using this, you can configure the auto update (daily or whenever).

  1. Run mkdir schcal in command line to create a directory.
  2. Write the following to the config file ~/.schcal/config.yaml
ICS_URLS:
  - https://calendar.google.com/calendar/ical/xxxxxxxxxxxxxxxxxxx/private-cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/basic.ics
  1. Write the following to the batch file schcal/on-schtask.bat
cd %~dp0
npx schcal > ./schcal.log
schtasks /Create /tn SSAC /sc daily /st 17:00 /tr %0 /F
  1. Then run on-schtask.bat which will update your tasks at 17:00 every day (you can change this by editing the bat file)

  2. Then run schtasks /Run /tn SSAC to test schtasks.

Other Methods

Run using command line.

npx schcal https://calendar.google.com/calendar/ical/xxxxxxxxxxxxxxxxxxx/private-cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/basic.ics

Or

npm i schtasks-calendar -g
schcal https://calendar.google.com/calendar/ical/xxxxxxxxxxxxxxxxxxx/private-cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/basic.ics

Run using config.yaml

Make a config.yaml like this

# Your ics urls, the order is not important
ICS_URLS:
  # snomiao's private calendar ( demo )
  - https://calendar.google.com/calendar/ical/snomiao%40gmail.com/private-d772b2790a1a73de26afb64188c5ca0a/basic.ics
  # a calendar
  - https://calendar.google.com/calendar/ical/xxxxxxxxxxxxxxxxxxx/private-cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/basic.ics
  # another calendar
  - https://calendar.google.com/calendar/ical/xxxxxxxxxxxxxxxxxxx/private-cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/basic.ics

# Optional, if you want cache the ics file (usually for debuging)... default value is 0 (no cache and never save a cache file)
# CACHE_TIMEOUT: 3600e3 # one hour

# Optional, if you need a proxy for Google... Otherwise you can delete this line. Default value is empty.
HTTP_PROXY: http://localhost:1080

# Optional, how many days events will add to schtasks, default value is 7 (then this program will )
FORWARD_DAYS: 7 # TODO: NEED TO DRAW A DIAGRAM TO EXPLAIN THIS

and run

npx schcal

in the working directory containing config.yaml .

Supported formats

You can put one link (for now, support for multiple links in development) of the following into the title or description fields of events to be launched as scheduled.

  1. Web Links: http://... , https://... , ftp://... , file://...
  2. Markdown Links: [ ... ]( ... )
  3. Run Command: RUN ...

(supports urls, custom protocols and local files)

TODOS

  • [ ] Translate this into chinese version README.md
  • [x] An wrapper CMD file.is needed to solving the error from schtasks.exe ERROR: Value for '/TR' option cannot be more than 261 character(s).

Q & A

  • Q: I saw "Unexpected token ." when using npx schcal.
  • A: You need to update your Nodejs to higher than v14.8.0 Click to download

References and further readings

About

License

GPLv3 - The GNU General Public License v3.0 - GNU Project - Free Software Foundation

Author

Author: snomiao [email protected] Website: snomiao.com

Sponsors

  • None yet.

Claim your sponsorship by donating snomiao <Email: [email protected]>

Contribute

The main repo is in here, any issue and PR's welcome.