Upgrade to Pro — share decks privately, control downloads, hide ads and more …

kosodate_engineer_meetup_2

Takumi KANZAKI
April 03, 2018
5.6k

 kosodate_engineer_meetup_2

Takumi KANZAKI

April 03, 2018
Tweet

Transcript

  1. Me & Family • @tknzk (Takumi Kanzaki) • SmartHR ͰόοΫΤϯυΑΓͷιϑτ΢ΣΞΤϯδχΞ

    • ࠺ • σδλϧίϯςϯπͷϓϩσϡʔαʔ / WebσΟϨΫλʔ • ່ • ver 2.5.x / อҭԂ3೥໨
  2. ࢠҭͯʹؔ͢Δ෉්ؒͷڞ௨ೝࣝ • ϋʔυ: ৯ચػ, ϧϯό, ચ୕ס૩ػ • ιϑτ: GoogleCalendar, Slack,

    Github • ৘ใΛΦʔϓϯʹ͠ඞཁͳͱ͖ʹඞཁͳ৘ใʹͦΕͧΕΞΫη εͰ͖ΔΑ͏͓ͯ͘͠
  3. GoogleHome • ςϨϏΛ͚ͭͨΓ (w/ NatureRemo) • র໌Λফͨ͠Γ (w/ NatureRemo) •

    চஆΛ͚ͭͨΓ (w/ SwitchBot) • ͓෩࿊Λڅ౬ͨ͠Γ (w/ SwitchBot) • ఱؾ༧ใΛฉ͍ͨΓ • ϥδΦΛฉ͍ͨΓ
  4. GCF 'use strict'; var request = require('request'); var config =

    require('config'); var iftttKey = config.IFTTT.key; var requestToken = config.IFTTT.request_token; exports.callIFTTTWebhook = (req, res) => { if (req.body.secret != requestToken) return; var triggers = req.body.triggers; for( var i in triggers) { var url = 'https://maker.ifttt.com/trigger/' + triggers[i] + '/with/key/' + iftttKey; var options = { url: url, method: 'POST', headers: { 'Content-Type':'application/json' } }; request(options, callback); } function callback(error, response, body) { if (error == true) { console.log(body); } } // send status res.status(200).send('ok'); };