<jupyter_start><jupyter_text>This example pulls random tweets from Twitter's streaming API, meaning it will keep gathering more data the longer you let it run.Hit the stop button in the header to stop it from gathering more data.<jupyter_code>api = tweepy.API(auth)

class StreamListener(tweepy.StreamListener):
    def on_status(self, tweet):
        print(tweet.author.screen_name + "\t" + tweet.text)

    def on_error(self, status_code):
        print('Error: ' + repr(status_code))
        return False

l = StreamListener()
streamer = tweepy.Stream(auth=auth, listener=l)


streamer.sample()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09728867623604466, 'fraction_numerical': 0.0, 'mean_word_length': 4.657657657657658, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '581954', 'license': 'MIT', 'n_tokens_mistral': 201, 'n_tokens_neox': 193, 'n_words': 57, 'path': 'stream_ex0_stream_random_tweets.ipynb', 'repo_name': 'CommunityDataScienceCollective/twitter-cdsw', 'size': '627'}