Gist d3be7947ba494f0cc785ad4ff966f6d5
✓ Published0🌍 Public
GGeorgeMcIntire
Last edited Jun 6, 2017
Created on Jun 6, 2017
This example demonstrates a workflow for collecting and structuring Twitter data through the streaming API. It uses the `tweepy` library to authenticate and open a live stream, filtering tweets by specified terms or hashtags, and saving each raw tweet as a JSON line to a file. The code then reads that file back, parses each tweet, and extracts selected fields into a nested list, including the text, user handle, favorite and retweet counts, timestamp, follower count, and language. Finally, it organizes the data into a structured pandas DataFrame with corresponding column names, preparing it for further analysis or visualization.
AI-generated description