Google Photosの画像がGyazoに流れるようにする
Google Photos API, しょぼいな
webhookないのか
あとダウンロード時に位置情報とか剥がされるっぽい

が言ってたのこれかな
IntegromatのGoogle Photos Integrationに、「Watch Media Items」がある
>Triggers when new photo or video is added
結局、全部Integromatでできた
パラメータについては、Google Photosの指定は入れない方が良さそう
それで繋がりが生まれてしまう
制限があるっぽい
Data transferがやばいな、100MBか
別に全部Integromatでやる必要はない
なので、画像の差分検知だけIntegromatでやって、実際の画像のダウンロードとかGyazoへのアップロードは別の場所でやると良さそう
そうすれば100MB制限も問題無い
.jsconst response = UrlFetchApp.fetch("https://i.gyazo.com/1b08bdea4dec4b2eddad408dd1eb97d2.png")
const blob = response.getBlob()
const res = UrlFetchApp.fetch("https://upload.gyazo.com/api/upload", {
method: "POST",
body: {
access_token: accessToken,
imageData: blob,
},
})
↑を試したけど、 400: request parameter imagedata should be image file binary of supported type(jpeg, png, ...).
が帰ってくる
なんでだろう..?
やってることはこれと同じ
bodyじゃなくてpayloadに変えたら動いた....
