1

I want to write a script on Google Apps Script which can access my Facebook friends list and sync the photo and other data with my Google contacts details.

I am trying to use FQL - but perhaps there is a better way. I have tried to read up a bit but can't really find where to begin - will I be able to access this via FQL or will I also need to write a Facebook application for this?

Has anyone attempted something similar or have any tips?


Edit: Ok, so I am trying to use a facebook app to access the data - but I can't even get it to return an access token.

Any ideas?

var url = "https://www.facebook.com/dialog/oauth?client_id={app_id}&redirect_uri=https://www.facebook.com/connect/login_success.html";
var response = UrlFetchApp.fetch(url);
var ret = response.getContentText();

Also, how can the token be stored in Google Apps Scripts? Would I need to create a new document and save the ID in that? It seems a bit messy..

1
  • You have to create a Facebook app, go through the login flow, and then with an access token you can query the data via API or FQL. If you have no clue how it all works, start here: developers.facebook.com/docs/facebook-login Commented Sep 16, 2013 at 19:59

1 Answer 1

1

For storing the token, I believe you can use the ScriptProperties facility:

Store:

ScriptProperties.setProperty("token", <your token goes here>);

Retrieve:

var token = ScriptProperties.getProperty("token");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.