def process_photo_comments(comments):
    if ('error' in comments):
        print('Error = ', error)
        raise Exception('Error in Response')
    if ('data' not in comments):
        return
    while (len(comments['data']) > 0):
        for comment in comments['data']:
            try:
                commentor = comment['from']['name'].encode('utf-8')
                if (commentor == OWNER_NAME):
                    continue
                word_count = len(comment['message'].encode('utf-8').split())
            except UnicodeEncodeError:
                print(comment['message'])
                raise Exception('Unicode Encoding Error Encountered')
            if (commentor in no_of_comments):
                no_of_comments[commentor] += 1
                words_in_comment[commentor] += word_count
            else:
                no_of_comments[commentor] = 1
                words_in_comment[commentor] = word_count
        if (('paging' in comments) and ('next' in comments['paging'])):
            request_str = comments['paging']['next'].replace('https://graph.facebook.com/', '')
            request_str = request_str.replace('limit=25', 'limit=200')
            comments = graph.get(request_str)
        else:
            comments['data'] = []
def process_photo_comments(comments):
    if ('error' in comments):
        print('Error = ', error)
        raise Exception('Error in Response')
    if ('data' not in comments):
        return
    while (len(comments['data']) > 0):
        for comment in comments['data']:
            try:
                commentor = comment['from']['name'].encode('utf-8')
                if (commentor == OWNER_NAME):
                    continue
                word_count = len(comment['message'].encode('utf-8').split())
            except UnicodeEncodeError:
                print(comment['message'])
                raise Exception('Unicode Encoding Error Encountered')
            if (commentor in no_of_comments):
                no_of_comments[commentor] += 1
                words_in_comment[commentor] += word_count
            else:
                no_of_comments[commentor] = 1
                words_in_comment[commentor] = word_count
        if (('paging' in comments) and ('next' in comments['paging'])):
            request_str = comments['paging']['next'].replace('https://graph.facebook.com/', )
            request_str = request_str.replace('limit=25', 'limit=200')
            comments = graph.get(request_str)
        else:
            comments['data'] = []