Last active
August 29, 2015 14:17
-
-
Save BetoFrega/490707802a9adbacc1ea to your computer and use it in GitHub Desktop.
get instagram followers through Google App Script
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
function puxa() { | |
var userID = "yyyyyy", // altere o yyyyyy pelo user id, mantendo as aspas em volta | |
access_token = "xxxx.xxxx.xxxxxxxxxxxx"; // altere o xxx... pelo access_token, mantendo as aspas em volta | |
// NÃO ALTERE A PARTIR DAQUI | |
var url= "https://api.instagram.com/v1/users/"+userID+"?access_token="+access_token, | |
content = UrlFetchApp.fetch(url); | |
myData = { | |
followers: JSON.parse(content).data.counts.followed_by, | |
updated: new Date() | |
} | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = ss.getSheets()[0]; | |
Logger.log(sheet.appendRow([myData.followers,myData.updated])); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment