SlideShare uma empresa Scribd logo
1 de 47
Twitter:Friends,
  Followers, and
Set wise Operations
How many friends/followers do I have?
Who am I following that is not following me
back?
Who is following me that I am not following
back?
Who are the friendliest and least friendly people
in my net work?
Who are my "mutual friends"?
Given all of my followers and all of their
followers, what is my potential influence if I get
ret weeted?
Twitter's RESTful API
/users/show
OAuth
A Lean, Mean Data-
Collection Machine
401(Not Authorized), 503(Over
Capacity) Error
t witter module throws
TwitterHTTPError
Use try/except block
Registering an app at http://
dev.t witter.com/apps/new
friend/follower data will return up to
5,000IDs per call
Users could retrieve up to 1,750,000 Ids
before rate limiting.(350 request/hour)
ID values seem to be in reverse
chronological order(the first->most
recently followed, the last-> the first
person you followed)
How to navigate IDs
Store/Retrieve
     OAuth token

read_token_file
write_token_file
Redis : A Data
 Structures Server
key-value store
Data structure ser ver that keys can
contain strings, hashes, lists, sets and
sorted sets.
make V=1
sudo make install
easy_install redis
redis-server
Redis : A Data
 Structures Server
key-value store
Data structure ser ver that keys can
contain strings, hashes, lists, sets and
sorted sets.
make V=1
sudo make install
easy_install redis
redis-server
Set Operations
Redis command
Souping Up the Machine
  with Basic Friend/
   Follower Metrics
Who isn't
following me back?

following -> 663 < 100*7
follower -> 1,423,704 < 100*350*41
Randomly sample and calculate
measures of statistical significance ->
srandmember
Calculating Similarity

 Computing common friends and
 followers is just set operation away.
 Use a set intersection -> sinterstore
EX 4-5
EX 4-5
EX 4-5
Measuring Influence

One trivial way to measure the relative
influence of t wo or more users is to
simply compare their number of
followers.
MAVENS - well connected and like to
share information.
Measuring Influence
Remove top 10 followers -> avg : 284
Remove less than 10 followers -> 1,000
Construction Friendship
       Graphs
Clique Detection and
      Analysis



An analysis of the similarity/diversity
of t weet content among members of a
large clique would be a very worthy in
t weet analysis
The Infochimps
"Strong Links" API
3D Graph Visualization

Mais conteúdo relacionado

Destaque

Objeto de aprendizaje
Objeto de aprendizajeObjeto de aprendizaje
Objeto de aprendizaje
ermidesb2
 
Les pronoms personneles
Les pronoms personnelesLes pronoms personneles
Les pronoms personneles
mabe050982
 
Initial ideas for FIlm Trailer
Initial ideas for FIlm TrailerInitial ideas for FIlm Trailer
Initial ideas for FIlm Trailer
Amymedia123
 

Destaque (13)

Entorns accessibles en l'educació del segle XXI
Entorns accessibles en l'educació del segle XXIEntorns accessibles en l'educació del segle XXI
Entorns accessibles en l'educació del segle XXI
 
андреев нцукс
андреев нцуксандреев нцукс
андреев нцукс
 
Open Research Infrastructure: how flexible is the backbone?
Open Research Infrastructure: how flexible is the backbone?Open Research Infrastructure: how flexible is the backbone?
Open Research Infrastructure: how flexible is the backbone?
 
The technology velocity_concept_in_clean_energy_project_design
The technology velocity_concept_in_clean_energy_project_designThe technology velocity_concept_in_clean_energy_project_design
The technology velocity_concept_in_clean_energy_project_design
 
Yunan
YunanYunan
Yunan
 
Antivirus
AntivirusAntivirus
Antivirus
 
國語課(1).pps
 國語課(1).pps  國語課(1).pps
國語課(1).pps
 
Unit I
Unit IUnit I
Unit I
 
Objeto de aprendizaje
Objeto de aprendizajeObjeto de aprendizaje
Objeto de aprendizaje
 
Gazeta01
Gazeta01Gazeta01
Gazeta01
 
Tesi: Confronto Kid Market cinese e statunitense
Tesi: Confronto Kid Market cinese e statunitenseTesi: Confronto Kid Market cinese e statunitense
Tesi: Confronto Kid Market cinese e statunitense
 
Les pronoms personneles
Les pronoms personnelesLes pronoms personneles
Les pronoms personneles
 
Initial ideas for FIlm Trailer
Initial ideas for FIlm TrailerInitial ideas for FIlm Trailer
Initial ideas for FIlm Trailer
 

Mais de Kyungryul KIM

전문검색기술도전
전문검색기술도전전문검색기술도전
전문검색기술도전
Kyungryul KIM
 
Nib_NSWindowController
Nib_NSWindowControllerNib_NSWindowController
Nib_NSWindowController
Kyungryul KIM
 
서버인프라를지탱하는기술5 1 2
서버인프라를지탱하는기술5 1 2서버인프라를지탱하는기술5 1 2
서버인프라를지탱하는기술5 1 2
Kyungryul KIM
 
Chaper24 languages high_and_low
Chaper24 languages high_and_lowChaper24 languages high_and_low
Chaper24 languages high_and_low
Kyungryul KIM
 
Ch22 운영체제
Ch22 운영체제Ch22 운영체제
Ch22 운영체제
Kyungryul KIM
 

Mais de Kyungryul KIM (20)

Ch4 pugixml
Ch4 pugixmlCh4 pugixml
Ch4 pugixml
 
Node ch12
Node ch12Node ch12
Node ch12
 
11.scripting
11.scripting11.scripting
11.scripting
 
32 osx app_release
32 osx app_release32 osx app_release
32 osx app_release
 
Meteor ddp
Meteor ddpMeteor ddp
Meteor ddp
 
Cocos2dx 7.1-7.2
Cocos2dx 7.1-7.2Cocos2dx 7.1-7.2
Cocos2dx 7.1-7.2
 
Cocos2 d x-7.3_4
Cocos2 d x-7.3_4Cocos2 d x-7.3_4
Cocos2 d x-7.3_4
 
Cocos2d x-ch5-1
Cocos2d x-ch5-1Cocos2d x-ch5-1
Cocos2d x-ch5-1
 
Coco2d x
Coco2d xCoco2d x
Coco2d x
 
23 drag drop
23 drag drop23 drag drop
23 drag drop
 
Hadoop ch5
Hadoop ch5Hadoop ch5
Hadoop ch5
 
전문검색기술도전
전문검색기술도전전문검색기술도전
전문검색기술도전
 
Nib_NSWindowController
Nib_NSWindowControllerNib_NSWindowController
Nib_NSWindowController
 
Dsas
DsasDsas
Dsas
 
서버인프라를지탱하는기술5 1 2
서버인프라를지탱하는기술5 1 2서버인프라를지탱하는기술5 1 2
서버인프라를지탱하는기술5 1 2
 
Chaper24 languages high_and_low
Chaper24 languages high_and_lowChaper24 languages high_and_low
Chaper24 languages high_and_low
 
Ch22 운영체제
Ch22 운영체제Ch22 운영체제
Ch22 운영체제
 
Mibis ch20
Mibis ch20Mibis ch20
Mibis ch20
 
Mibis ch15
Mibis ch15Mibis ch15
Mibis ch15
 
Mibis ch8
Mibis ch8Mibis ch8
Mibis ch8
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

MTSW-Twitter-1

  • 1. Twitter:Friends, Followers, and Set wise Operations
  • 2. How many friends/followers do I have? Who am I following that is not following me back? Who is following me that I am not following back? Who are the friendliest and least friendly people in my net work? Who are my "mutual friends"? Given all of my followers and all of their followers, what is my potential influence if I get ret weeted?
  • 3.
  • 7. A Lean, Mean Data- Collection Machine 401(Not Authorized), 503(Over Capacity) Error t witter module throws TwitterHTTPError Use try/except block
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13. Registering an app at http:// dev.t witter.com/apps/new friend/follower data will return up to 5,000IDs per call Users could retrieve up to 1,750,000 Ids before rate limiting.(350 request/hour) ID values seem to be in reverse chronological order(the first->most recently followed, the last-> the first person you followed)
  • 15. Store/Retrieve OAuth token read_token_file write_token_file
  • 16. Redis : A Data Structures Server key-value store Data structure ser ver that keys can contain strings, hashes, lists, sets and sorted sets. make V=1 sudo make install easy_install redis redis-server
  • 17. Redis : A Data Structures Server key-value store Data structure ser ver that keys can contain strings, hashes, lists, sets and sorted sets. make V=1 sudo make install easy_install redis redis-server
  • 20. Souping Up the Machine with Basic Friend/ Follower Metrics
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26. Who isn't following me back? following -> 663 < 100*7 follower -> 1,423,704 < 100*350*41 Randomly sample and calculate measures of statistical significance -> srandmember
  • 27. Calculating Similarity Computing common friends and followers is just set operation away. Use a set intersection -> sinterstore
  • 31. Measuring Influence One trivial way to measure the relative influence of t wo or more users is to simply compare their number of followers. MAVENS - well connected and like to share information.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37. Remove top 10 followers -> avg : 284 Remove less than 10 followers -> 1,000
  • 39. Clique Detection and Analysis An analysis of the similarity/diversity of t weet content among members of a large clique would be a very worthy in t weet analysis
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.

Notas do Editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. lean and mean &amp;#xAE30;&amp;#xB97C; &amp;#xC4F0;&amp;#xACE0;, &amp;#xB208;&amp;#xC5D0; &amp;#xBD88;&amp;#xC744; &amp;#xBC1D;&amp;#xD788;&amp;#xACE0;,\n
  8. \n
  9. \n
  10. \n
  11. secret_code\n
  12. &amp;#xD638;&amp;#xCD9C;&amp;#xB2F9; 5,000&amp;#xBA85;\n350*5,000 = 1,750,000\n&amp;#xC774;&amp;#xC804;&amp;#xD654;&amp;#xBA74;&amp;#xC5D0;&amp;#xC11C; user id&amp;#xB294; &amp;#xCC98;&amp;#xC74C;&amp;#xC774; &amp;#xCD5C;&amp;#xCD08; &amp;#xD3F4;&amp;#xB85C;&amp;#xC789;, &amp;#xB9C8;&amp;#xC9C0;&amp;#xB9C9;&amp;#xC774; &amp;#xCC98;&amp;#xC74C; &amp;#xD3F4;&amp;#xB85C;&amp;#xC789;.\n
  13. \n
  14. \n
  15. &amp;#xC2A4;&amp;#xD2B8;&amp;#xB9C1;,&amp;#xD574;&amp;#xC26C;,&amp;#xB9AC;&amp;#xC2A4;&amp;#xD2B8;,&amp;#xC14B;&amp;#xC744; &amp;#xD0A4;&amp;#xB85C; &amp;#xAC00;&amp;#xC9C8; &amp;#xC218; &amp;#xC788;&amp;#xB2E4;.\n
  16. \n
  17. scard - &amp;#xBA64;&amp;#xBC84;&amp;#xC218;\n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. &amp;#xB450;&amp;#xBA85;&amp;#xC758; &amp;#xC720;&amp;#xC800;&amp;#xAC00; &amp;#xB9CE;&amp;#xC740; &amp;#xC218;&amp;#xC758; &amp;#xB3D9;&amp;#xC77C;&amp;#xD55C; &amp;#xC0AC;&amp;#xB78C;&amp;#xB4E4;&amp;#xC744; &amp;#xD3F4;&amp;#xB85C;&amp;#xC789;&amp;#xD558;&amp;#xACE0; &amp;#xC788;&amp;#xB2E4;&amp;#xBA74; &amp;#xADF8; &amp;#xC0AC;&amp;#xB78C; &amp;#xB450;&amp;#xBA85;&amp;#xC740; &amp;#xC720;&amp;#xC0AC;&amp;#xD55C; &amp;#xAD00;&amp;#xC2EC; &amp;#xC0AC;&amp;#xD56D;&amp;#xC774; &amp;#xC788;&amp;#xC744; &amp;#xAC83;&amp;#xC774;&amp;#xB2E4;.\n
  25. &amp;#xACF5;&amp;#xD1B5;&amp;#xC758; &amp;#xCE5C;&amp;#xAD6C;&amp;#xC640; &amp;#xD3F4;&amp;#xB85C;&amp;#xC6CC; &amp;#xACC4;&amp;#xC0B0;&amp;#xC744; &amp;#xAD50;&amp;#xC9D1;&amp;#xD569;&amp;#xC744; &amp;#xD1B5;&amp;#xD574; &amp;#xC218;&amp;#xD589;&amp;#xD55C;&amp;#xB2E4;.\nscard - &amp;#xBA64;&amp;#xBC84; &amp;#xC218;.\n
  26. &amp;#xACF5;&amp;#xD1B5;&amp;#xC758; &amp;#xCE5C;&amp;#xAD6C;&amp;#xC640; &amp;#xD3F4;&amp;#xB85C;&amp;#xC6CC; &amp;#xACC4;&amp;#xC0B0;&amp;#xC744; &amp;#xAD50;&amp;#xC9D1;&amp;#xD569;&amp;#xC744; &amp;#xD1B5;&amp;#xD574; &amp;#xC218;&amp;#xD589;&amp;#xD55C;&amp;#xB2E4;.\nscard - &amp;#xBA64;&amp;#xBC84; &amp;#xC218;.\n
  27. &amp;#xB2E8;&amp;#xC21C;&amp;#xD55C; &amp;#xBC29;&amp;#xBC95;&amp;#xC740; &amp;#xD3F4;&amp;#xB85C;&amp;#xC6CC; &amp;#xC218;&amp;#xAC00; &amp;#xB9CE;&amp;#xC740; &amp;#xC0AC;&amp;#xB78C;.\n
  28. &amp;#xAC00;&amp;#xC7A5; &amp;#xB2E8;&amp;#xC21C;&amp;#xD55C; &amp;#xCE21;&amp;#xC815; &amp;#xBC29;&amp;#xBC95;&amp;#xC740; &amp;#xC790;&amp;#xC2E0;&amp;#xC758; &amp;#xD3F4;&amp;#xB85C;&amp;#xC6CC;&amp;#xC911; &amp;#xD3F4;&amp;#xB85C;&amp;#xC6CC;&amp;#xC218;&amp;#xAC00; &amp;#xB9CE;&amp;#xC740; &amp;#xC0AC;&amp;#xB78C;.\neasy_install prettytable\n
  29. &amp;#xD3F4;&amp;#xB85C;&amp;#xC6CC;&amp;#xC758; &amp;#xCE5C;&amp;#xAD6C;/&amp;#xD3F4;&amp;#xB85C;&amp;#xC6CC; &amp;#xC218;&amp;#xB97C; &amp;#xC218;&amp;#xC9D1;&amp;#xD558;&amp;#xC5EC; redis&amp;#xC5D0; &amp;#xC800;&amp;#xC7A5;&amp;#xD55C;&amp;#xB2E4;.\ndepth =1\n
  30. &amp;#xC800;&amp;#xC7A5;&amp;#xB41C; &amp;#xCE5C;&amp;#xAD6C;/&amp;#xD3F4;&amp;#xB85C;&amp;#xC6B0;&amp;#xC5D0;&amp;#xC11C; &amp;#xAC00;&amp;#xC7A5; &amp;#xB192;&amp;#xC740; &amp;#xC21C;&amp;#xC73C;&amp;#xB85C; &amp;#xCD9C;&amp;#xB825;&amp;#xD55C;&amp;#xB2E4;.\n
  31. &amp;#xC0C1;&amp;#xC704; 10&amp;#xBA85;&amp;#xC744; &amp;#xC81C;&amp;#xC678;&amp;#xD558;&amp;#xBA74; 284,\n&amp;#xD558;&amp;#xC704; 10&amp;#xBA85;&amp;#xC744; &amp;#xC81C;&amp;#xC678;&amp;#xD558;&amp;#xBA74; 1000\n
  32. \n
  33. &amp;#xD2B8;&amp;#xC717;&amp;#xBD84;&amp;#xC11D;&amp;#xC744; &amp;#xD560; &amp;#xB54C; &amp;#xD070; &amp;#xD074;&amp;#xB9AC;&amp;#xD06C;&amp;#xC5D0;&amp;#xC11C; &amp;#xD2B8;&amp;#xC717;&amp;#xC758; &amp;#xC720;&amp;#xC0AC;&amp;#xC131;&amp;#xACFC; &amp;#xB2E4;&amp;#xC591;&amp;#xC131;&amp;#xC744; &amp;#xBD84;&amp;#xC11D;&amp;#xD558;&amp;#xB294; &amp;#xAC83;&amp;#xC740; &amp;#xD6A8;&amp;#xC728;&amp;#xC801;&amp;#xC774;&amp;#xB2E4;.\n
  34. &amp;#xD074;&amp;#xB9AC;&amp;#xD06C;&amp;#xB97C; &amp;#xCC3E;&amp;#xB294; &amp;#xBC29;&amp;#xBC95;&amp;#xC740; &amp;#xB9E4;&amp;#xC6B0; &amp;#xC5B4;&amp;#xB835;&amp;#xC9C0;&amp;#xB9CC; NetworkX&amp;#xC5D0;&amp;#xC11C; find_cliques&amp;#xB97C; &amp;#xC9C0;&amp;#xC6D0;&amp;#xD55C;&amp;#xB2E4;.\n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n