Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Social Media Mining with Python

You're reading from   Mastering Social Media Mining with Python Unearth deeper insight from your social media data with advanced Python techniques for acquisition and analysis

Arrow left icon
Product type Paperback
Published in Jul 2016
Publisher Packt
ISBN-13 9781783552016
Length 338 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Marco Bonzanini Marco Bonzanini
Author Profile Icon Marco Bonzanini
Marco Bonzanini
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Social Media, Social Data, and Python FREE CHAPTER 2. #MiningTwitter – Hashtags, Topics, and Time Series 3. Users, Followers, and Communities on Twitter 4. Posts, Pages, and User Interactions on Facebook 5. Topic Analysis on Google+ 6. Questions and Answers on Stack Exchange 7. Blogs, RSS, Wikipedia, and Natural Language Processing 8. Mining All the Data! 9. Linked Data and the Semantic Web

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...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image