<commit_before>from tweepy import OAuthHandler, Stream
from tweepy.streaming import StreamListener

consumer_key        = '1nvYyChmmQB3wXTPZ5MJDQ5qG'
consumer_secret     = '<KEY>'
access_token      = 	'<KEY>'
access_token_secret = 	'<KEY>'

auth = OAuthHandler(consumer_key,
                    consumer_secret)
auth.set_access_token(access_token,
                      access_token_secret)

class PrintListener(StreamListener):
    def on_status(self, status):
        print(status.text)
        print(status.author.screen_name,
              status.created_at,
              status.source,
              '\n')

    def on_error(self,status_code):
        print("Error code: {}".format(status_code))
        return True # keep stream alive

    def on_timeout(self):
        print('Listener timed out!')
        return True # Keep stream alive

def print_to_terminal():
    listener = PrintListener()
    stream = Stream(auth, listener)
    stream.sample()

if __name__ == '__main__':
    print_to_terminal()<commit_msg>streamed only english and original tweets<commit_after>from tweepy import OAuthHandler, Stream
from tweepy.streaming import StreamListener

consumer_key        = '1nvYyChmmQB3wXTPZ5MJDQ5qG'
consumer_secret     = '<KEY>'
access_token      = 	'<KEY>'
access_token_secret = 	'<KEY>'

auth = OAuthHandler(consumer_key,
                    consumer_secret)
auth.set_access_token(access_token,
                      access_token_secret)

class PrintListener(StreamListener):
    def on_status(self, status):
        if not status.text[:3] == 'RT ':
            print(status.text)
            print(status.author.screen_name,
                  status.created_at,
                  status.source,
                  '\n')

    def on_error(self,status_code):
        print("Error code: {}".format(status_code))
        return True # keep stream alive

    def on_timeout(self):
        print('Listener timed out!')
        return True # Keep stream alive

def print_to_terminal():
    listener = PrintListener()
    stream = Stream(auth, listener)
    languages = ('en',)
    stream.sample(languages=languages)

if __name__ == '__main__':
    print_to_terminal()
{'fraction_non_alphanumeric': 0.09659613615455381, 'fraction_numerical': 0.004139834406623735, 'mean_word_length': 2.7243150684931505, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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}}
{'dir': 'git-commits-cleaned', 'id': '6164299', 'n_tokens_mistral': 671, 'n_tokens_neox': 643, 'n_words': 138}