たれぱんのびぼーろく

わたしの備忘録、生物学とプログラミングが多いかも

AWS lambdaからGoogleカレンダーを操作する

GoogleカレンダーAPIを用いて、AWS lambdaからカレンダーへの予定追加をおこなう

Use Case

  • AWSリソースの変更をhookしてカレンダーに記録
  • 任意のタイミングで情報処理→カレンダーに記録
    • e.g. IFTTT_buttonWodget => AWS API Gateway => lambda => カレンダー
      • 起床したらボタン押す。就寝時間と突き合わせた上で、睡眠時間をカレンダーに登録

VAL-opsin

脊髄に発現が認められ、緑色光を吸収するopsin.
個体では、ゼブラフィッシュ27hpfの自発活動(coiling)が抑制される. (KOで抑制がみられなくなる)

www.ncbi.nlm.nih.gov

encoding an ortholog of vertebrate ancient (VA) opsin, the function of which is unknown.

IFTTT

webサービスを組み合わせて、自分だけの自動化ツールを創り出せ!
というのがIFTTT(イフト)

3 ways to build

  • Maker
  • Partner
  • Partner Plus

applets & services

  • Applets: bring your services togather to create new experiences
  • Services: the apps and devices you use every day. Each service has useful applets you can turn on.

類似サービス

思ったこと

マイクロサービスに似てるよね.

用語

用語ががっつりと変わったのではないかな…?

古そうな用語

  • レシピ/recipes: Applets (formerly known as recipes) are the predicates made from Triggers and Actions IFTTT - Wikipedia
  • チャンネル/channels: Services (formerly known as channels) are the “basic building blocks of IFTTT” IFTTT - Wikipedia

目覚ましシステム

ボタンpush => IFTTT webhook => AWS API Gateway => AWS lambda => AWS S3 => view site (pooling)

ボタンpush

IFTTT Button widget Do more with Button widget - IFTTT
amazon dash button改造して物理ボタンに置換したいところ.

IFTTT webhook

http request
ifttt.com

AWS API Gateway

lambda連携. access key認証にとりあえずしたい。現在開放中

AWS lambda

API Gateway連携.
access keyでAWS S3認証中. IAMで認証にしたいところ.

AWS S3

public readなsleepLog.jsonにデータ保存. アクセス制限かけたいね.

view site

html.
xhrしたjsonをVue.jsでリスト化.
rawデータの加工と表示を取り入れたい.

AWS lambda

  • event (1st arg): arguments by caller
  • context (2nd arg): runtime information
  • callback (3rd, optional arg): return information to caller
    • callback(error, results)
      • error: null(success) or any
      • results: must be JSON.stringify compatible

When the callback is called (explicitly or implicitly), AWS Lambda continues the Lambda function invocation until the Node.js event loop is empty.

起動法