Presentation is loading. Please wait.

Presentation is loading. Please wait.

Social Network Analysis

Similar presentations


Presentation on theme: "Social Network Analysis"— Presentation transcript:

1 Social Network Analysis
Recipe 1.13, 1.14 Choi Dong-Soo

2 Recipe 1.13 1.13 Harvesting Friends and Followers Problem Solution
You want to harvest all of the friends or followers for a particular user. Solution Use the robust make_twitter_request function from Recipe 1.9 to collect all of the friend or follower ids via a long-running process.

3 Recipe 1.13

4 Recipe 1.13 REST API v1.1 Limits per window by resource
For example, 15 requests per hour at 5,000 ids per request works out to be 300 thousand ids per hour.

5 Recipe 1.13 Cursor Tuple(Previous_Cursor, Next_Cursor)

6 Recipe 1.13 File Name oauth ID Screen Name Max ids
0:Friends / 1:Followers

7 Recipe 1.13 Result Friends

8 Recipe 1.13 Result Followers

9 Recipe 1.14 1.14 Performing Setwise Operations on Friendship Data
Problem You want to operate on collections of friends and followers to answer questions such as “Who isn’t following me back?”, “Who are my mutual friends?”, and “What friends/followers do certain users have in common?”. Solution Use setwise operations such as the difference and intersection operations to answer these questions.

10 Recipe 1.14 Redis Install : http://redis.io/download
Install : Commands :

11 Recipe 1.14 sadd () scard() sdiffstore() sinterstore()
Add one or more members to a set scard() Get the number of members in a set sdiffstore() Subtract multiple sets and store the resulting set in a key sinterstore() Intersect multiple sets and store the resulting set in a key

12 Recipe 1.14 Oisoo 30000 24728 30000 friend_ids follows_ids

13 Recipe 1.14 Result

14 Recipe 1.14 24527 201 29799 friend_ids follows_ids

15 Thank you.


Download ppt "Social Network Analysis"

Similar presentations


Ads by Google