38
Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington, Seattle International Population Conference 2017, Cape Town Many Thanks to IUSSP and Hewlett Foundation for their support

Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

Welcome to the

IUSSP Workshop on Social Media and

Demographic Research

Emilio Zagheni & Connor Gilroy

University of Washington, Seattle

International Population Conference 2017, Cape Town

Many Thanks to IUSSP and Hewlett Foundationfor their support

Page 2: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

IUSSP Panel on Big Data and Population

Processes

Tom$Le$Grand$

Ingmar$Weber$

Page 3: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

Recent activities of the IUSSP Panel

I Hands-on Training WorkshopsI at Population Association of America (2016 and 2017)I at European Population Conference (2016)I at Brazilian+Latin American Population Conference

(2016)

I Mini-conferences/Research WorkshopsI at the International Conference on Web and Social

Media (2016 and 2017)I at Social Informatics Conference (2016)

I Tutorials for (mainly) computer scientistsI Tutorial on ‘Digital Demography’ at the World Wide

Web Conference (2017) and at the InternationalConference on Computational Social Science (2017)

Page 4: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

Lots of people contributed beyond the IUSSP

panel...

I Directly by preparing and/or teachingmodules :

- Monica Alexander, Nina Cesare, Lee Fiorio, CharlesLanfear, Kivan Polimis, Joan Ryan, . . .

I Indirectly by developing packages for R andPython

- E.g., Pablo Barbera, Matheus Araujo

Page 5: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

Links to available materials

1. European Population Conference 2016

workshop:

https://github.com/CSDE-UW/

iussp-mainz-social-media

2. Latin American Pop Conference 2016

workshop:

https://github.com/ezagheni/

IUSSP-Social-Media-Workshop-at-ALAP-ABEP

3. Tutorial at WWW Conference 2017:

https://t.co/4HJjeVgIEr

Page 6: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

Upcoming Research Workshop

The workshop will be held in July in Shanghai, as a sidemeeting of APA

Page 7: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

General goals for today’s workshop

3 broad questions:

1. How to collect and analyze social media data?

2. How can social scientists benefit from andcontribute to social media research?

3. What are some examples of researchquestions in the emerging area of ‘digitaldemography’?

⇒ Emphasis on having fun with hands-onactivities

Page 8: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

Not everything runs smoothly the first time...

Page 9: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

...but eventually we will get there

Page 10: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

Plan for today

1. Introduction to APIs (Application

Programming interfaces)

2. Collecting Twitter data using R

3. Facebook Data for Advertisers: a new

source and research examples

4. Collecting Facebook Data for

Advertisers

5. Discussion

Page 11: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

Materials for the workshop

I Materials for today’s workshop are

available on this github page:

https://github.com/CSDE-UW/

IUSSP-digital-demog-2017

Page 12: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

Four main modules

Page 13: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

Download the material and unzip the folder for

each module

Page 14: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

Drinking from a hose...

Page 15: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

Intro to accessing data viaAPIs

Page 16: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

Among others, we will consider data like this...

Page 17: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

or tweets like this one:

Twitter Twitter API Analysis of Twitter data In-class exercise

Anatomy of a tweet

Lab 3 Social Media and Political Participation Jan. 8 11/19credit: Pablo Barbera

Page 18: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

Twitter Twitter API Analysis of Twitter data In-class exercise

Anatomy of a tweet

Tweets are stored in JSON format:

{ "created_at": "Wed Nov 07 04:16:18 +0000 2012",

"id": 266031293945503744,

"text": "Four more years. http://t.co/bAJE6Vom",

"source": "web",

"user": {

"id": 813286,

"name": "Barack Obama",

"screen_name": "BarackObama",

"location": "Washington, DC",

"description": "This account is run by Organizing for Action staff.

Tweets from the President are signed -bo.",

"url": "http://t.co/8aJ56Jcemr",

"protected": false,

"followers_count": 40873124,

"friends_count": 654580,

"listed_count": 202495,

"created_at": "Mon Mar 05 22:08:25 +0000 2007",

"time_zone": "Eastern Time (US & Canada)",

"statuses_count": 10687,

"lang": "en" },

"coordinates": null,

"retweet_count": 783488,

"favorite_count": 295026,

"lang": "en"

}

Lab 3 Social Media and Political Participation Jan. 8 12/19credit: Pablo Barbera

Page 19: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

Twitter Twitter API Analysis of Twitter data In-class exercise

Anatomy of a tweet

Tweets are stored in JSON format:

{ "created_at": "Wed Nov 07 04:16:18 +0000 2012",

"id": 266031293945503744,

"text": "Four more years. http://t.co/bAJE6Vom",

"source": "web",

"user": {

"id": 813286,

"name": "Barack Obama",

"screen_name": "BarackObama",

"location": "Washington, DC",

"description": "This account is run by Organizing for Action staff.

Tweets from the President are signed -bo.",

"url": "http://t.co/8aJ56Jcemr",

"protected": false,

"followers_count": 40873124,

"friends_count": 654580,

"listed_count": 202495,

"created_at": "Mon Mar 05 22:08:25 +0000 2007",

"time_zone": "Eastern Time (US & Canada)",

"statuses_count": 10687,

"lang": "en" },

"coordinates": null,

"retweet_count": 783488,

"favorite_count": 295026,

"lang": "en"

}

Lab 3 Social Media and Political Participation Jan. 8 12/19

Key: value

Page 20: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

Twitter Twitter API Analysis of Twitter data In-class exercise

Anatomy of a tweet

Tweets are stored in JSON format:

{ "created_at": "Wed Nov 07 04:16:18 +0000 2012",

"id": 266031293945503744,

"text": "Four more years. http://t.co/bAJE6Vom",

"source": "web",

"user": {

"id": 813286,

"name": "Barack Obama",

"screen_name": "BarackObama",

"location": "Washington, DC",

"description": "This account is run by Organizing for Action staff.

Tweets from the President are signed -bo.",

"url": "http://t.co/8aJ56Jcemr",

"protected": false,

"followers_count": 40873124,

"friends_count": 654580,

"listed_count": 202495,

"created_at": "Mon Mar 05 22:08:25 +0000 2007",

"time_zone": "Eastern Time (US & Canada)",

"statuses_count": 10687,

"lang": "en" },

"coordinates": null,

"retweet_count": 783488,

"favorite_count": 295026,

"lang": "en"

}

Lab 3 Social Media and Political Participation Jan. 8 12/19

Values canbe lists

Page 21: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

How do we access these data?

Credit: Brian Cooksey

Page 22: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

How do we access these data?

Credit: Brian Cooksey

Page 23: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

Example of integrated Websites

Page 24: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

Example of integrated Websites

Page 25: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

University of Washington campus

Page 26: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

Communication typically happens via HTTP

Credit: Brian Cooksey

Page 27: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

Communication typically happens via HTTP

Credit: Brian Cooksey

Page 28: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

Authentication

I We have all registered for a website before(e.g., Facebook, Google, Dropbox, etc.):

I Logging-in with a username and password isan example of authentication

I A different example: The developer of a gameapp can use the Dropbox API to let usersstore their saved games in the Dropbox cloud

I Would you share your Dropbox username andpassword with the game developer?

Page 29: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

Authentication

I We have all registered for a website before(e.g., Facebook, Google, Dropbox, etc.):

I Logging-in with a username and password isan example of authentication

I A different example: The developer of a gameapp can use the Dropbox API to let usersstore their saved games in the Dropbox cloud

I Would you share your Dropbox username andpassword with the game developer?

Page 30: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

Authentication

I We have all registered for a website before(e.g., Facebook, Google, Dropbox, etc.):

I Logging-in with a username and password isan example of authentication

I A different example: The developer of a gameapp can use the Dropbox API to let usersstore their saved games in the Dropbox cloud

I Would you share your Dropbox username andpassword with the game developer?

Page 31: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

Authentication

I We have all registered for a website before(e.g., Facebook, Google, Dropbox, etc.):

I Logging-in with a username and password isan example of authentication

I A different example: The developer of a gameapp can use the Dropbox API to let usersstore their saved games in the Dropbox cloud

I Would you share your Dropbox username andpassword with the game developer?

Page 32: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

Authentication

I We have all registered for a website before(e.g., Facebook, Google, Dropbox, etc.):

I Logging-in with a username and password isan example of authentication

I A different example: The developer of a gameapp can use the Dropbox API to let usersstore their saved games in the Dropbox cloud

I Would you share your Dropbox username andpassword with the game developer?

Page 33: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

API Key Authentication

I It is a technique to overcome the weakness ofsharing credentials

I The key is usually a long series of letters andnumbers that is distinct from the accountowner’s login password

I The owner gives the key to the application

I The owner can restrict administrativeprivileges associated with the key

Page 34: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

API Key Authentication

I It is a technique to overcome the weakness ofsharing credentials

I The key is usually a long series of letters andnumbers that is distinct from the accountowner’s login password

I The owner gives the key to the application

I The owner can restrict administrativeprivileges associated with the key

Page 35: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

API Key Authentication

I It is a technique to overcome the weakness ofsharing credentials

I The key is usually a long series of letters andnumbers that is distinct from the accountowner’s login password

I The owner gives the key to the application

I The owner can restrict administrativeprivileges associated with the key

Page 36: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

API Key Authentication

I It is a technique to overcome the weakness ofsharing credentials

I The key is usually a long series of letters andnumbers that is distinct from the accountowner’s login password

I The owner gives the key to the application

I The owner can restrict administrativeprivileges associated with the key

Page 37: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

API Key Authentication

I It is a technique to overcome the weakness ofsharing credentials

I The key is usually a long series of letters andnumbers that is distinct from the accountowner’s login password

I The owner gives the key to the application

I The owner can restrict administrativeprivileges associated with the key

Page 38: Welcome to the IUSSP Workshop on Social Media and ... · Welcome to the IUSSP Workshop on Social Media and Demographic Research Emilio Zagheni & Connor Gilroy University of Washington,

Let’s look at some real-life examples and

applications