• How to make images from Google Photos flow into Gyazo.

  • Using Google Photos API and Gyazo API.

  • Using GAS seems good, since it’s a Google API.

  • Google Photos API is not that great.

    • Is there no webhook?
    • Also, it seems that location information is stripped off when downloading.
      • Is this what (masui) was talking about?
    • https://github.com/gilesknap/gphotos-sync
    • Integromat has a “Watch Media Items” feature in its Google Photos Integration.
      • Triggers when new photo or video is added.

      • It seems possible to achieve this by using the Gyazo API to send the obtained images to Gyazo.
  • In the end, everything was done with Integromat.

    • It seems better not to specify the parameters for Google Photos.
      • That’s how the connection is established.
    • There seem to be some limitations.
      • Data transfer is a problem, only 100MB.
        • image
    • It’s not necessary to do everything with Integromat.
      • So, it seems better to use Integromat only for detecting image differences, and to handle the actual image downloads and uploads to Gyazo in a different place.
      • That way, the 100MB limit is not a problem.

.js

const 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,
  },
})

I tried the above, but I get 400: request parameter imagedata should be image file binary of supported type(jpeg, png, ...).