Notes and activities from a Google+ page
After searching for a Google+ page and visualizing the results in a web GUI, we will proceed to download a list of activities for a given page. Activities are the Google+ equivalent of Facebook posts. By default, an activity is considered to be a note, that is, a piece of text shared on Google+.
The following script, gplus_get_page_activities.py
, is used to collect a list of activities from a Google+ page:
# Chap05/gplus_get_page_activities.py import os import json from argparse import ArgumentParser from apiclient.discovery import build def get_parser(): parser = ArgumentParser() parser.add_argument('--page') parser.add_argument('--max-results', type=int, default=100) return parser if __name__ == '__main__': api_key = os.environ.get('GOOGLE_API_KEY') parser = get_parser() args = parser.parse_args() service = build('plus', 'v1', developerKey=api_key) activity_feed = service...