1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【GAS】Instagram Graph APIから他ユーザーの投稿画像を取得する

Posted at

はじめに

Instagram Graph APIから得たmedia_urlから画像を取得します。
以前の記事にて、Instagram Graph APIからmedia_urlを取得しています。
https://qiita.com/mai3blog/items/427496b3273de73acbcb

完成品

メディアのURLから取得した画像を隣の列に貼り付けています。
media_url.JPG

やること

  1. Instagram Graph APIからmedia_urlを取得
  2. media_urlからIMAGE関数を用いて画像を取得

ここでは2のやりかたを説明します。

URLデータからサムネイルを取得

// media_urlから画像の貼り付け
    let formula = "=IMAGE(\"URL\")";//画像URLから画像を取得
    let cell = writeSheet.getRange(1,1);//画像貼り付け位置
    cell.setValue(formula);//画像貼り付け

以前作成したinstagramのmedia_urlから画像貼り付けた場合

以前作成した記事は以下になります。
https://qiita.com/mai3blog/items/427496b3273de73acbcb

// media_urlから画像の貼り付け
    let formula = "=IMAGE(\"" + media_media_url[i] + "\")";
    let cell = writeSheet.getRange(i+lastrow,5);
    cell.setValue(formula);
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?