SlideShare a Scribd company logo
SOCIAL NETWORK ANALYSIS WITH R
David Chiu @ 中興大學
ABOUT ME
Co-founder of NumerInfo
Trend Micro Engineer
ywchiu-tw.appspot.com
AGENDA
What is Social Network?
Why to Analyze Social Network?
How to Analyze
Social Network Connection (Oauth, Oauth2, OpenID)
Social Network Analysis With R
Social Network Visualization (Gephi)
Facebook Post Liked Analysis
Conclusion
SOCIAL NETWORK

http://libeltyseo.com/wp-content/uploads/2013/03/social-networking.png
HUMAN NATURE

http://cdn.macado.com/assets/2010/03/peeping-tom.gif
WHAT DO WE WANT TO KNOW?
Who knows whom, and which people are common to their
social networks?
How frequently are particular people communicating with one
another?
Which social network connections generate the most value for
a particular niche?
How does geography affect your social connections in an
online world?
Who are the most influential/popular people in a social
network?
What are people chatting about (and is it valuable)?
What are people interested in based upon the human language
that they use in a digital world?
EXPLORE FACEBOOK
LESSON 1: CONNECT TO SOCIAL NETWORK
OAuth Flow
Oauth v.s. OAuth2
OpenID
OAUTH FLOW
Open standard for authorization. OAuth provides a method for
clients to access server resources on behalf of a resource owner
DIFFERENCE BETWEEN OAUTH AND OAUTH2
More OAuth Flows to allow better support for non-browser
based applications
OAuth 2.0 no longer requires client applications to have
cryptography
OAuth 2.0 signatures are much less complicated
OAuth 2.0 Access tokens are "short-lived"
OAuth 2.0 is meant to have a clean separation of roles
between the server responsible for handling OAuth requests
and the server handling user authorization
OPENID
Open standard that allows users to be authenticated by certain
co-operating sites
CONNECT TO FACEBOOK

https://developers.facebook.com/
GET ACCESS TOKEN

https://developers.facebook.com/tools/explorer/
USER PERMISSION
PERMISSION LIST
User Data Permissions:
user_hometown
user_location
user_interests
user_likes
user_relationships
Friends Data Permissions:
friends_hometown
friends_location
friends_interests
friends_likes
friends_relationships
Extended Permissions:
read_friendlists
COPY TOKEN
LESSON 2: SOCIAL NETWORK ANALYSIS WITH
R
Let's Hack
REQUIRED PACKAGES
RCurl
General network (HTTP/FTP/...) client interface for R
rjson
JSON for R
XML
Tools for parsing and generating XML within R and S-Plus
igraph
Network analysis and visualization
bitops
Bitwise Operations
REQUIRED PACKAGE
i sa lp ca e( ( rs n,Ru l ,X L, ir p'' io s) dp ne c e= RE
n tl . ak gs c' jo ''C r' 'M ' ' g ah,b tp ' ,e ed ni sT U)
l ba yr sn
i rr ( jo )
l ba yR ul
i rr ( Cr )
l ba yX L
i rr ( M)
l ba yi rp )
i rr ( ga h
l ba yb tp )
i rr ( io s
FACEBOOK CONNECT

f _o nc < f nt o ( p t = " e, ac s_ oe = tk n ot os {
b cn e t - u c in a h
m" ce s tk n
o e, p in )
i ( !i sn (p i n) )
f m si go to s {
o to s< s rn f "% " ps e nm s o to s ,"" ul s( pi n) c la s ="
p i n - p i t( ?s, a t( ae ( pi n) =, ni to t os , ol pe
&
o to s< g u( ,, "2 " o to s
p i n - s b "" %C, p in )
u l< s rn f "t p: / r p .a eo kc m% % &c es tk n % " pt , ot os a c
r - p it ( ht s /g ah fc bo . o/ssac s _o e= s, a h pi n , c
}e s {
le
u l< s rn f "t p: / r p .a eo kc m% ? ce st kn %" p t, a cs _o e )
r - p it ( ht s /g ah fc bo . o/sa cs _ oe=s , ah c es t kn
}
dt < gt R ( u l s l vr fp e =F LE )
aa - e UL r , s. ei y er
AS
fo JO (d t )
rm S N aa
}
TEST ON API EXPLORER
EXECUTED RESULT
> f_ on c( m" a cs _o e)
bc n et "e ,c es t kn
$d
i
[ ]" 72 48 "
1 7 8 28 9
$ ae
nm
[ ]" ai C i"
1 Dvd hu
$ is _a e
f rt n m
[ ]" ai "
1 Dvd
$ at nm
l s_ a e
[ ]" hu
1 Ci"
$ ik
ln
[ ]" tp :/ w. a eo kc mC i Y"
1 h t s/ ww fc bo . o/ hu W
$ sr ae
u en m
[ ]" hu W
1 C i Y"
GET FRIEND LIST
> fi ns < f_ on c (a h" ef in s,a cs _o e=c es tk n
re d - bc n et pt =m / re d" c es t kn ac s_ oe )
> fi ns
re d
GET FRIEND GROUP LIST
f in go p < f _ on c( pt = m/ re di t" a cs _ oe =c es tk n
r ed r us - bc ne t a h" ef in l ss, ce st kn ac s _o e)
f in go p. d < sp l (r ed ru s d t,f nt o()xi)
r ed r us i
- a py fi n go p$ aa u c inx $d
f in go p. ae < sp l (r ed ru s d t,f nt o()xn m)
r ed r us nm - a py fi n go p$ aa u c inx $a e
FACEBOOK ELEMENT EXTRACTOR

# Gt Fi ns If r ai nF o F
e r ed n om to rm B
m < f_ on c( a h" e, ac s _o e= ce st k n o t osls (f ed ""d nm ,o
e - b cn et pt =m " c es tk na c s_ oe , pi n=it " il s=i, a el c
m nm < m$ ae
y ae - e nm
f in s< m $r ed
r ed - e fi n s
# Et at Fc bo I s
xr c a eo k D
f in si < sp l (r ed $a a fn to ( )x i)
r ed . d - a py fi n sd t , u ci nx $ d

# Et at F Mt I fr ai n
xr c B ea n om t o
f in sn m < u l s( ap yf i ns dt ,f nt o () i ov xn m , o' T 8, u= " )
r ed . ae - ni ts p l( re d$ aa uc in x
c n( $a e t= UF 's b " ) )
f in sg ne < s pl (r ed $ aa fn t o( )u ls ( fi . u l x gn e ) " o e e
r ed . ed r - a py f in sd t, u ci nx ni ti (s nl ( $e dr ) nn " l
f in sl ct o. d < u l s( ap yf in s dt,f nt o () xl ct o$ d )
r ed . oa in i - ni ts p l( re d$ aa uc in x $o a in i)
f in sl ct o. a e< u ls (a py fi n sd t , fn t o( ){ f( s n l ( $ oa in
r ed . oa in nm - n it s pl (r ed $a a u ci nx i i. ulxl c to$
f in sh mt w. a e< u ls (a py fi n sd t , fn t o( ){ f( s n l ( $ oe on
r ed . oe on nm - n it s pl (r ed $a a u ci nx i i. ulxh m tw$
GET FRIENDSHIP MATRIX

f in si s< f nt o( {
r ed h p - u c in )
pi t" ee ai g fi ns i mt i"
rn ( Gn rt n re d hp a rx)
N< l nt (r ed .d
- e gh fi n si )
fi ns i. ar x < m t i(,, )
re d hp mt i - ar x0N N
fr ( i 1N {
o i n :)
p it ps ei f in sn m[ ] )
r n (a t( ,r ed . ae i)
t p< f cb o( pt = at (m /u ul r ed " fi nsi [ ] sp"" , ac s _o e
m - a e o k a h p s e " e m t a f i n s , r e d . d i , e =/ )
c es tk
m ta fi ns < sp l (m $a a fn to () xi)
u u lr ed - a py tp d t, uc i nx $d
f in si .a r xi fi ns i %n m ta fi n s < 1
r e dh pm ti [, r ed .d i % u u lr ed ] }
#C et c ne to sw t m fi ns
r a e o nc i n ih y r ed
fi ns cn < c1N
re d _o - ( :)
fi ns cn ]< 1
re d _o [ #A dt i vc o a a c lm t te fi n si m ti
d hs et r s
o un o h r ed hp a rx
fi ns i. ar x < c i df in si .a r xf in sc n
re d hp mt i - bn (r e dh pm ti ,r e d_ o)
#A pn m fi n si w t m s l
p e d y r ed hp i h ye f
fi ns i. ar x < r i df in si .a r xa pn (r e d_ o, )
re d hp mt i - bn (r e dh pm ti ,p e df in sc n 0 )
rw ae (r ed h pm ti )< a pn (r e d. aemn m )
on m sf in si .a r x - pe df in sn m,y ae
cl ae (r ed h pm ti )< a pn (r e d. aemn m )
on m sf in si .a r x - pe df in sn m,y ae
rt r (r ed hpmt i )
eu n fi ns i.a rx
}
FRIEND GRAPH

f in ga h< f nt o( r ed hpmt i ) {
r ed r p - u c in fi ns i.a rx
f i n s i . r p < g a h a j c n y f i n s i . a r x m d = (u d r c e " , w i h e =
re d hp ga h - r p.d ae c ( re d hp mt i, o ec"n i et d) e g tdN
Vf in si .r p )g ne < a pn (r ed .e d r m s l$ ed r
(r e dh pg ah $e d r - p ed fi n sg ne , ye fg ne )
V f i n s i . r p ) l c t o < a p n ( r e d . o a i nn m , m s l $ o a i n n m )
(r e dh pg ah $o a in - pe df i ns lc to . ae y ef lc t o$ ae
V f i n s i . r p ) h m t w < a p n ( r e d . o e o nn m , m s l $ o e o n n m )
(r e dh pg ah $o e on - pe df i ns hm tw . ae y ef hm t w$ ae
Vf in si .r p )L bl < Vf in si . rp )n m
(r e dh pg ah $a e - ( re dh pg ah $ ae
rt r ( re dh p ga h
eu n fi ns i. rp )
}
DRAW FRIENDSHIP GRAPH
f mt i < f in s is )
_ ar x - re dh p(
f ga h< f in ga hf m ti)
_ rp - r ed r p( _a rx
w ie ga hf ga h "r e d. rp m" fr a =g ah l )
r t. r p ( _r p, f in sg a hl ,o mt "r p m"
GRAPH XML FORAMT (GRAPHML)
LESSON 3: SOCIAL NETWORK VISUALIZATION
Using Gephi
GEPHI
Gephi, an open source graph visualization and manipulation
software
MODULARITY
Measure of the structure of networks or graphs. It was
designed to measure the strength of division of a network into
modules
Networks with high modularity have dense connections
between the nodes within modules but sparse connections
between nodes in different modules
LEARN MORE ABOUT GEPHI
https://www.udemy.com/gephi/
GET LIKES COUNT OF POSTS

r qi ep y)
e ur ( lr
p ss < f_ on c( ah " ep ss ,a cs _ oe =c es t kn ot o sl s( fe d "" i
o t - bc ne t pt =m /o t " ce st kn a cs _o e, p in =i t "i ls =l
p s. ie < sp l (o t$ aa f nt o( ) xl ks
o tl k s - a py ps s dt , uc in x $i e )
p s. ie .a a< s pl ( ot lk s fn to () x dt )
o tl k sd t - ap yp s. i e, uc i nx $ aa
l =l s (
i
it )
f r( i 1l nt ( ot lk sd t ){
o i n : eg hp s. i e. aa )
fr ( i 1(e g hp s. ie . aa [])1)
o j n :l nt (o t lk sd t [ i]- ){
l < a p n ( i p s . i e . a a [ ] [ j ]n m )
i - p ed l, o tl ks d t[ i] []$a e
}
}
d =d. al ri dd t. r m, l)
f
oc l( bn . aa fa e i
c la e( f < c " ae )
o nm s d) - (n m"
d py d, .n m) s ma i e N m us =l nt (a e )
d l( f ( ae , um rz , uS b
e g hn m)
CONCLUSION REMARK
Interesting Fact Abour Friends
Value Behind The Network
Statstic Is Worth More Than Thousand of Words
YOUR TURN TO DO SOME ANALYSIS
Find Popular Checkins Among Your Friends
Common Interest Between Your Friends
Female/Male Distribution of Your Know Friends
Most Pupular Photos Being Liked
Asociation Rule of Friends (Gossip)
THANK YOU

More Related Content

PPTX
Representing Material Culture Online: Historic Clothing in Omeka
PDF
PyLadies Talk: Learn to love the command line!
PDF
Geb for Testing Your Grails Application GR8Conf India 2016
PDF
Continuous delivery with Gradle
PDF
No Flex Zone: Empathy Driven Development
PDF
Flow of events during Media Player creation in Android
PDF
密瑪學原理與技術
PDF
網路攻擊技術分析
Representing Material Culture Online: Historic Clothing in Omeka
PyLadies Talk: Learn to love the command line!
Geb for Testing Your Grails Application GR8Conf India 2016
Continuous delivery with Gradle
No Flex Zone: Empathy Driven Development
Flow of events during Media Player creation in Android
密瑪學原理與技術
網路攻擊技術分析

What's hot (14)

PDF
Piotr Szotkowski about "Ruby smells"
PPTX
Evolving the Android Core with Aspects
PDF
PostgreSQL Day italy 2016 Unit Test
PDF
穏やかにファイルを削除する
PDF
Profiling Web Archives IIPC GA 2015
PDF
Vim your Python, Python your Vim
PDF
Додаток 3
PDF
Modeling avengers – open source technology mix for saving the world
PPTX
Demystifying Unicode - Longhorn PHP 2021
PDF
Modeling avengers – open source technology mix for saving the world econ fr
PDF
SecureSocial - Authentication for Play Framework
PDF
Petunjuk pengisian lhkpn model a
DOCX
TicsDzm
PDF
Breathe life into your designer!
Piotr Szotkowski about "Ruby smells"
Evolving the Android Core with Aspects
PostgreSQL Day italy 2016 Unit Test
穏やかにファイルを削除する
Profiling Web Archives IIPC GA 2015
Vim your Python, Python your Vim
Додаток 3
Modeling avengers – open source technology mix for saving the world
Demystifying Unicode - Longhorn PHP 2021
Modeling avengers – open source technology mix for saving the world econ fr
SecureSocial - Authentication for Play Framework
Petunjuk pengisian lhkpn model a
TicsDzm
Breathe life into your designer!
Ad

Similar to Social Network Analysis With R (20)

PDF
Using Phing for Fun and Profit
PDF
Testing Fuse Fabric with Pax Exam
PDF
Piotr Szotkowski about "Bits of ruby"
PPTX
Introduction to Asymmetric Cipher decipher
PPTX
From simple to more advanced: Lessons learned in 13 months with Tableau
PDF
Geb for browser automation
PDF
Frontend architecture on big and small sites
PDF
Create Custom Post Type Plugin
PDF
IPC13 Munich: Planning the Unplannable
PDF
WordPress in 30 minutes
PDF
Escalas hglvf set 2015
PDF
JavaFX, because you're worth it
PDF
PyData Paris 2015 - Track 3.2 Serge Guelton et Pierrick Brunet
PDF
Spring Roo 2.0 Preview at Spring I/O 2016
PDF
Spring scala - Sneaking Scala into your corporation
PPT
SC4 Workshop 1: Helena Gellerman: data analyses in transport
PDF
kidaagacertificates
PDF
Certificates
TXT
Winload.efi.mui
PDF
Accessible Web Components_Techshare India 2014
Using Phing for Fun and Profit
Testing Fuse Fabric with Pax Exam
Piotr Szotkowski about "Bits of ruby"
Introduction to Asymmetric Cipher decipher
From simple to more advanced: Lessons learned in 13 months with Tableau
Geb for browser automation
Frontend architecture on big and small sites
Create Custom Post Type Plugin
IPC13 Munich: Planning the Unplannable
WordPress in 30 minutes
Escalas hglvf set 2015
JavaFX, because you're worth it
PyData Paris 2015 - Track 3.2 Serge Guelton et Pierrick Brunet
Spring Roo 2.0 Preview at Spring I/O 2016
Spring scala - Sneaking Scala into your corporation
SC4 Workshop 1: Helena Gellerman: data analyses in transport
kidaagacertificates
Certificates
Winload.efi.mui
Accessible Web Components_Techshare India 2014
Ad

More from David Chiu (10)

PDF
無中生有 - 利用外部數據打造新商業模式
PPTX
洞見未來,用python 與 r 結合深度學習技術預測趨勢
PDF
python 實戰資料科學工作坊
PDF
新聞 X 謊言 用文字探勘挖掘財經新聞沒告訴你的真相(丘祐瑋)
PDF
Data Analysis - Making Big Data Work
PDF
PyCon APAC 2014 - Social Network Analysis Using Python (David Chiu)
PPTX
Big Data Analysis With RHadoop
PDF
Machine Learning With R
PPTX
R language tutorial
PPT
Hidden Markov Model & Stock Prediction
無中生有 - 利用外部數據打造新商業模式
洞見未來,用python 與 r 結合深度學習技術預測趨勢
python 實戰資料科學工作坊
新聞 X 謊言 用文字探勘挖掘財經新聞沒告訴你的真相(丘祐瑋)
Data Analysis - Making Big Data Work
PyCon APAC 2014 - Social Network Analysis Using Python (David Chiu)
Big Data Analysis With RHadoop
Machine Learning With R
R language tutorial
Hidden Markov Model & Stock Prediction

Recently uploaded (20)

PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Electronic commerce courselecture one. Pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
KodekX | Application Modernization Development
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Encapsulation theory and applications.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
A Presentation on Artificial Intelligence
PPTX
Cloud computing and distributed systems.
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Digital-Transformation-Roadmap-for-Companies.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Electronic commerce courselecture one. Pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Spectral efficient network and resource selection model in 5G networks
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Unlocking AI with Model Context Protocol (MCP)
Mobile App Security Testing_ A Comprehensive Guide.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
KodekX | Application Modernization Development
20250228 LYD VKU AI Blended-Learning.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Encapsulation theory and applications.pdf
The AUB Centre for AI in Media Proposal.docx
A Presentation on Artificial Intelligence
Cloud computing and distributed systems.
Bridging biosciences and deep learning for revolutionary discoveries: a compr...

Social Network Analysis With R

  • 1. SOCIAL NETWORK ANALYSIS WITH R David Chiu @ 中興大學
  • 2. ABOUT ME Co-founder of NumerInfo Trend Micro Engineer ywchiu-tw.appspot.com
  • 3. AGENDA What is Social Network? Why to Analyze Social Network? How to Analyze Social Network Connection (Oauth, Oauth2, OpenID) Social Network Analysis With R Social Network Visualization (Gephi) Facebook Post Liked Analysis Conclusion
  • 6. WHAT DO WE WANT TO KNOW? Who knows whom, and which people are common to their social networks? How frequently are particular people communicating with one another? Which social network connections generate the most value for a particular niche? How does geography affect your social connections in an online world? Who are the most influential/popular people in a social network? What are people chatting about (and is it valuable)? What are people interested in based upon the human language that they use in a digital world?
  • 8. LESSON 1: CONNECT TO SOCIAL NETWORK OAuth Flow Oauth v.s. OAuth2 OpenID
  • 9. OAUTH FLOW Open standard for authorization. OAuth provides a method for clients to access server resources on behalf of a resource owner
  • 10. DIFFERENCE BETWEEN OAUTH AND OAUTH2 More OAuth Flows to allow better support for non-browser based applications OAuth 2.0 no longer requires client applications to have cryptography OAuth 2.0 signatures are much less complicated OAuth 2.0 Access tokens are "short-lived" OAuth 2.0 is meant to have a clean separation of roles between the server responsible for handling OAuth requests and the server handling user authorization
  • 11. OPENID Open standard that allows users to be authenticated by certain co-operating sites
  • 15. PERMISSION LIST User Data Permissions: user_hometown user_location user_interests user_likes user_relationships Friends Data Permissions: friends_hometown friends_location friends_interests friends_likes friends_relationships Extended Permissions: read_friendlists
  • 17. LESSON 2: SOCIAL NETWORK ANALYSIS WITH R Let's Hack
  • 18. REQUIRED PACKAGES RCurl General network (HTTP/FTP/...) client interface for R rjson JSON for R XML Tools for parsing and generating XML within R and S-Plus igraph Network analysis and visualization bitops Bitwise Operations
  • 19. REQUIRED PACKAGE i sa lp ca e( ( rs n,Ru l ,X L, ir p'' io s) dp ne c e= RE n tl . ak gs c' jo ''C r' 'M ' ' g ah,b tp ' ,e ed ni sT U) l ba yr sn i rr ( jo ) l ba yR ul i rr ( Cr ) l ba yX L i rr ( M) l ba yi rp ) i rr ( ga h l ba yb tp ) i rr ( io s
  • 20. FACEBOOK CONNECT f _o nc < f nt o ( p t = " e, ac s_ oe = tk n ot os { b cn e t - u c in a h m" ce s tk n o e, p in ) i ( !i sn (p i n) ) f m si go to s { o to s< s rn f "% " ps e nm s o to s ,"" ul s( pi n) c la s =" p i n - p i t( ?s, a t( ae ( pi n) =, ni to t os , ol pe & o to s< g u( ,, "2 " o to s p i n - s b "" %C, p in ) u l< s rn f "t p: / r p .a eo kc m% % &c es tk n % " pt , ot os a c r - p it ( ht s /g ah fc bo . o/ssac s _o e= s, a h pi n , c }e s { le u l< s rn f "t p: / r p .a eo kc m% ? ce st kn %" p t, a cs _o e ) r - p it ( ht s /g ah fc bo . o/sa cs _ oe=s , ah c es t kn } dt < gt R ( u l s l vr fp e =F LE ) aa - e UL r , s. ei y er AS fo JO (d t ) rm S N aa }
  • 21. TEST ON API EXPLORER
  • 22. EXECUTED RESULT > f_ on c( m" a cs _o e) bc n et "e ,c es t kn $d i [ ]" 72 48 " 1 7 8 28 9 $ ae nm [ ]" ai C i" 1 Dvd hu $ is _a e f rt n m [ ]" ai " 1 Dvd $ at nm l s_ a e [ ]" hu 1 Ci" $ ik ln [ ]" tp :/ w. a eo kc mC i Y" 1 h t s/ ww fc bo . o/ hu W $ sr ae u en m [ ]" hu W 1 C i Y"
  • 23. GET FRIEND LIST > fi ns < f_ on c (a h" ef in s,a cs _o e=c es tk n re d - bc n et pt =m / re d" c es t kn ac s_ oe ) > fi ns re d
  • 24. GET FRIEND GROUP LIST f in go p < f _ on c( pt = m/ re di t" a cs _ oe =c es tk n r ed r us - bc ne t a h" ef in l ss, ce st kn ac s _o e) f in go p. d < sp l (r ed ru s d t,f nt o()xi) r ed r us i - a py fi n go p$ aa u c inx $d f in go p. ae < sp l (r ed ru s d t,f nt o()xn m) r ed r us nm - a py fi n go p$ aa u c inx $a e
  • 25. FACEBOOK ELEMENT EXTRACTOR # Gt Fi ns If r ai nF o F e r ed n om to rm B m < f_ on c( a h" e, ac s _o e= ce st k n o t osls (f ed ""d nm ,o e - b cn et pt =m " c es tk na c s_ oe , pi n=it " il s=i, a el c m nm < m$ ae y ae - e nm f in s< m $r ed r ed - e fi n s # Et at Fc bo I s xr c a eo k D f in si < sp l (r ed $a a fn to ( )x i) r ed . d - a py fi n sd t , u ci nx $ d # Et at F Mt I fr ai n xr c B ea n om t o f in sn m < u l s( ap yf i ns dt ,f nt o () i ov xn m , o' T 8, u= " ) r ed . ae - ni ts p l( re d$ aa uc in x c n( $a e t= UF 's b " ) ) f in sg ne < s pl (r ed $ aa fn t o( )u ls ( fi . u l x gn e ) " o e e r ed . ed r - a py f in sd t, u ci nx ni ti (s nl ( $e dr ) nn " l f in sl ct o. d < u l s( ap yf in s dt,f nt o () xl ct o$ d ) r ed . oa in i - ni ts p l( re d$ aa uc in x $o a in i) f in sl ct o. a e< u ls (a py fi n sd t , fn t o( ){ f( s n l ( $ oa in r ed . oa in nm - n it s pl (r ed $a a u ci nx i i. ulxl c to$ f in sh mt w. a e< u ls (a py fi n sd t , fn t o( ){ f( s n l ( $ oe on r ed . oe on nm - n it s pl (r ed $a a u ci nx i i. ulxh m tw$
  • 26. GET FRIENDSHIP MATRIX f in si s< f nt o( { r ed h p - u c in ) pi t" ee ai g fi ns i mt i" rn ( Gn rt n re d hp a rx) N< l nt (r ed .d - e gh fi n si ) fi ns i. ar x < m t i(,, ) re d hp mt i - ar x0N N fr ( i 1N { o i n :) p it ps ei f in sn m[ ] ) r n (a t( ,r ed . ae i) t p< f cb o( pt = at (m /u ul r ed " fi nsi [ ] sp"" , ac s _o e m - a e o k a h p s e " e m t a f i n s , r e d . d i , e =/ ) c es tk m ta fi ns < sp l (m $a a fn to () xi) u u lr ed - a py tp d t, uc i nx $d f in si .a r xi fi ns i %n m ta fi n s < 1 r e dh pm ti [, r ed .d i % u u lr ed ] } #C et c ne to sw t m fi ns r a e o nc i n ih y r ed fi ns cn < c1N re d _o - ( :) fi ns cn ]< 1 re d _o [ #A dt i vc o a a c lm t te fi n si m ti d hs et r s o un o h r ed hp a rx fi ns i. ar x < c i df in si .a r xf in sc n re d hp mt i - bn (r e dh pm ti ,r e d_ o) #A pn m fi n si w t m s l p e d y r ed hp i h ye f fi ns i. ar x < r i df in si .a r xa pn (r e d_ o, ) re d hp mt i - bn (r e dh pm ti ,p e df in sc n 0 ) rw ae (r ed h pm ti )< a pn (r e d. aemn m ) on m sf in si .a r x - pe df in sn m,y ae cl ae (r ed h pm ti )< a pn (r e d. aemn m ) on m sf in si .a r x - pe df in sn m,y ae rt r (r ed hpmt i ) eu n fi ns i.a rx }
  • 27. FRIEND GRAPH f in ga h< f nt o( r ed hpmt i ) { r ed r p - u c in fi ns i.a rx f i n s i . r p < g a h a j c n y f i n s i . a r x m d = (u d r c e " , w i h e = re d hp ga h - r p.d ae c ( re d hp mt i, o ec"n i et d) e g tdN Vf in si .r p )g ne < a pn (r ed .e d r m s l$ ed r (r e dh pg ah $e d r - p ed fi n sg ne , ye fg ne ) V f i n s i . r p ) l c t o < a p n ( r e d . o a i nn m , m s l $ o a i n n m ) (r e dh pg ah $o a in - pe df i ns lc to . ae y ef lc t o$ ae V f i n s i . r p ) h m t w < a p n ( r e d . o e o nn m , m s l $ o e o n n m ) (r e dh pg ah $o e on - pe df i ns hm tw . ae y ef hm t w$ ae Vf in si .r p )L bl < Vf in si . rp )n m (r e dh pg ah $a e - ( re dh pg ah $ ae rt r ( re dh p ga h eu n fi ns i. rp ) }
  • 28. DRAW FRIENDSHIP GRAPH f mt i < f in s is ) _ ar x - re dh p( f ga h< f in ga hf m ti) _ rp - r ed r p( _a rx w ie ga hf ga h "r e d. rp m" fr a =g ah l ) r t. r p ( _r p, f in sg a hl ,o mt "r p m"
  • 29. GRAPH XML FORAMT (GRAPHML)
  • 30. LESSON 3: SOCIAL NETWORK VISUALIZATION Using Gephi
  • 31. GEPHI Gephi, an open source graph visualization and manipulation software
  • 32. MODULARITY Measure of the structure of networks or graphs. It was designed to measure the strength of division of a network into modules Networks with high modularity have dense connections between the nodes within modules but sparse connections between nodes in different modules
  • 33. LEARN MORE ABOUT GEPHI https://www.udemy.com/gephi/
  • 34. GET LIKES COUNT OF POSTS r qi ep y) e ur ( lr p ss < f_ on c( ah " ep ss ,a cs _ oe =c es t kn ot o sl s( fe d "" i o t - bc ne t pt =m /o t " ce st kn a cs _o e, p in =i t "i ls =l p s. ie < sp l (o t$ aa f nt o( ) xl ks o tl k s - a py ps s dt , uc in x $i e ) p s. ie .a a< s pl ( ot lk s fn to () x dt ) o tl k sd t - ap yp s. i e, uc i nx $ aa l =l s ( i it ) f r( i 1l nt ( ot lk sd t ){ o i n : eg hp s. i e. aa ) fr ( i 1(e g hp s. ie . aa [])1) o j n :l nt (o t lk sd t [ i]- ){ l < a p n ( i p s . i e . a a [ ] [ j ]n m ) i - p ed l, o tl ks d t[ i] []$a e } } d =d. al ri dd t. r m, l) f oc l( bn . aa fa e i c la e( f < c " ae ) o nm s d) - (n m" d py d, .n m) s ma i e N m us =l nt (a e ) d l( f ( ae , um rz , uS b e g hn m)
  • 35. CONCLUSION REMARK Interesting Fact Abour Friends Value Behind The Network Statstic Is Worth More Than Thousand of Words
  • 36. YOUR TURN TO DO SOME ANALYSIS Find Popular Checkins Among Your Friends Common Interest Between Your Friends Female/Male Distribution of Your Know Friends Most Pupular Photos Being Liked Asociation Rule of Friends (Gossip)