comment
import json import datetime import csv import time import ssl from utils import request_until_succeed, open_csv_w from secrets import FACEBOOK_APP_ID, FACEBOOK_APP_SECRET # to get comments from a page you will need to run the other scripts first context = ssl._create_unverified_context() # this file_id must be the same as the ids you used to compile the posts using the other facebook scripts file_id = "brooklynmuseum" # get authentication access_token = FACEBOOK_APP_ID + "|" + FACEBOOK_APP_SECRET # Needed to write tricky unicode correctly to csv def unicode_normalize(text): return text.translate({ 0x2018:0x27, 0x2019:0x27, 0x201C:0x22, 0x201D:0x22, 0xa0:0x20 }).encode('utf-8') def getFacebookCommentFeedData(status_id, access_token, num_comments): # Construct the URL string base = "https://graph.facebook.com/v2.9" node = "/%s/comments" % status_id fields = "?fields=id,m...