Skip to content

Instantly share code, notes, and snippets.

@BetoFrega
Last active August 29, 2015 14:17
Show Gist options
  • Save BetoFrega/490707802a9adbacc1ea to your computer and use it in GitHub Desktop.
Save BetoFrega/490707802a9adbacc1ea to your computer and use it in GitHub Desktop.
get instagram followers through Google App Script
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