MINING TWITTER 1.7 Visualizing a Graph of Retweet Relationships
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.
Graphviz digraph G {Hello->World}
Code Example Visualizing a graph of retweet relationships with Graphviz
Code Example Visualizing a graph of retweet relationships with Graphviz
TEST reTweet Example Visualizing a graph of retweet relationships with Graphviz
Result output file graphviz strict digraph { crlayh -> alexjung87[tweet_id= ]; crlayh -> CrlAyh[tweet_id= ]; } strict digraph { crlayh -> alexjung87[tweet_id= ]; crlayh -> CrlAyh[tweet_id= ]; } Example Visualizing a graph of retweet relationships with Graphviz
Code Example Visualizing a graph of retweet relationships with Protovis
Code Example Visualizing a graph of retweet relationships with Protovis
Results html codeweb browser
MINING TWITTER 1.8 Capturing Tweets in Real-time with the Streaming API
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.
Code 트윗내용 사용자이름 작성시간 작성위치
Result
tweepy.streaming.Stream.filter Follow = ‘user_id’ Track = ‘keyworld’ Async = ‘True of False’ Locations = ‘GEO.’ Conunt = ‘’ Stall_warnings = ‘’
filter follow=[‘user_id’]
filter Async=[‘True’]