Skip to content
/ cmmt Public

๐Ÿšž personal commute log scripts

Notifications You must be signed in to change notification settings

chitacan/cmmt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

cmmt

์ถœํ‡ด๊ทผ, ๊ทผ๋ฌด ์‹œ๊ฐ„์„ ๊ธฐ๋กํ•˜๊ณ  ๊ด€๋ฆฌํ•˜๊ธฐ ์œ„ํ•œ ์Šคํฌ๋ฆฝํŠธ ๋ชจ์Œ.

cli client

๊ตฌ๊ธ€ ์‹œํŠธ์— ๊ธฐ๋ก๋œ ๊ทผ๋ฌด์‹œ๊ฐ„์„ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

oclif Version Downloads/week License

development

$ npm install
$ npm link .

usage

$ npm install -g cmmt
$ cmmt --help
$ cmmt
Query Sheet... done

Date  Duration (minutes)
02/17 07:53    473
02/18 08:28    508
02/19 07:30    450
02/20 08:03    483
02/21 08:15    495

Name           Duration
total          40:09
total (+today) 40:09
left           -00:09
left  (+today) -00:09

publish

$ npm version (major|minor|patch)
$ npm publish

Apps Script

clasp

์ถœ๊ทผ๊ณผ ํ‡ด๊ทผ ์‹œ๊ฐ์„ ์ง€์ •๋œ ๊ตฌ๊ธ€ ์‹œํŠธ์— ๊ธฐ๋กํ•ฉ๋‹ˆ๋‹ค. iOS Shortcuts ์•ฑ์—์„œ clasp ์œผ๋กœ ๋ฐฐํฌ๋œ Apps Script ์— HTTP GET ์š”์ฒญ์„ ๋ณด๋‚ด ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

setup

clasp ์„ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค. clasp ์œผ๋กœ ์‹คํ–‰, ๋ฐฐํฌํ•˜๊ธฐ ์œ„ํ•ด ์Šคํฌ๋ฆฝํŠธ ํ”„๋กœ์ ํŠธ๋ฅผ gcp ์™€ ์—ฐ๋™ํ•ฉ๋‹ˆ๋‹ค.

$ clasp login --creds cred.json
$ clasp create --rootDir scripts --parentId <DRIVE_ID>

development

$ clasp push
$ clasp run 'main' -p '["CLOCK_IN", "๊น€๊ฒฝ์—ด", {"pad": "0211"}]'
$ clasp run 'query' -p '["๊น€๊ฒฝ์—ด"]'
$ clasp logs --watch

deploy

$ clasp deployments
$ clasp deploy --deploymentId <DEPLOYMENT_ID>

iOS Shortcut

  • NFC ํƒœ๊ทธ๊ฐ€ ์Šค์บ”๋˜์—ˆ์„๋•Œ ์‹คํ–‰ํ•  Shortcut ์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

์ถœ๊ทผ, ํ‡ด๊ทผ์— ๊ฑธ๋ฆฐ ์‹œ๊ฐ„์„ Timing ์— ๊ธฐ๋กํ•ฉ๋‹ˆ๋‹ค. iOS Shortcuts ์•ฑ์—์„œ Timing Web API ๋ฅผ ํ˜ธ์ถœํ•ด์„œ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

  • NFC ํƒœ๊ทธ๊ฐ€ ์Šค์บ”๋˜์—ˆ์„๋•Œ ์‹คํ–‰ํ•  Shortcut ์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.