Created
February 8, 2021 12:50
-
-
Save letswritetw/3b88ae47aedba3efdf779760f6f198ec to your computer and use it in GitHub Desktop.
ig-oembed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getToken = '部署完取得的網址'; | |
const igUri = 'IG 貼文的網址'; | |
const hideCaption = true; // 要不要隱藏描述,true 隱藏、false 不隱藏 | |
fetch(getToken) | |
.then(response => response.json()) | |
.then(response => response.access_token) | |
.then(token => { | |
fetch(`https://graph.facebook.com/v9.0/instagram_oembed?url=${igUri}&access_token=${token}&hidecaption=${hideCaption}`) | |
.then(response => response.json()) | |
.then(response => { | |
console.log(response); | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment