Download presentation
Presentation is loading. Please wait.
Published byTabitha Osborne Modified over 8 years ago
1
MINING TWITTER 1.7 Visualizing a Graph of Retweet Relationships
2
Problem You want to visualize a graph of retweets (or just about anything else) with a staple like Graphviz or a JavaScript toolkit such as Protovis. Solution Emit DOT language output and convert the output to a static image with Graphviz, or emit JSON output that’s consumable by Protovis or your JavaScript toolkit of choice.
3
Graphviz http://www.graphviz.org digraph G {Hello->World}
4
Code Example 1-15. Visualizing a graph of retweet relationships with Graphviz
5
Code Example 1-15. Visualizing a graph of retweet relationships with Graphviz
6
TEST reTweet Example 1-15. Visualizing a graph of retweet relationships with Graphviz
7
Result output file graphviz strict digraph { crlayh -> alexjung87[tweet_id=317193154556211200]; crlayh -> CrlAyh[tweet_id=317245516201218049]; } strict digraph { crlayh -> alexjung87[tweet_id=317193154556211200]; crlayh -> CrlAyh[tweet_id=317245516201218049]; } Example 1-15. Visualizing a graph of retweet relationships with Graphviz
8
Code Example 1-16. Visualizing a graph of retweet relationships with Protovis
9
Code Example 1-16. Visualizing a graph of retweet relationships with Protovis
10
Results html codeweb browser
11
MINING TWITTER 1.8 Capturing Tweets in Real-time with the Streaming API
12
Problem You want to capture a stream of public tweets in real-time, optionally filtering by select screen names or keywords in the text of the tweet. Solution Use Twitter’s streaming API.
13
Code 트윗내용 사용자이름 작성시간 작성위치
14
Result
15
tweepy.streaming.Stream.filter Follow = ‘user_id’ Track = ‘keyworld’ Async = ‘True of False’ Locations = ‘GEO.’ Conunt = ‘’ Stall_warnings = ‘’
16
filter follow=[‘user_id’]
17
filter Async=[‘True’]
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.