Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
this script lets twitter tell u that ur a piece of shit in real time
from __future__ import unicode_literals
from twython import TwythonStreamer, TwythonError
import time
import pyttsx
# too lazy to ask twr for handle. u put ur handle here
MY_HANDLE = 'thricedotted'
# im shitty so i put my credentials in a plain file lol
with open('./.twittertest') as f: exec(
# if ur not shitty, put ur credentials here
#api_key = ''
#api_secret = ''
#access_token = ''
#access_token_secret = ''
# tts engine shit whatever
engine = pyttsx.init()
engine.setProperty('voice', 'english-us')
engine.setProperty('rate', 100)
# ugh
def exclude_word(word):
return any(x in word for x in ('@', 'http'))
class ShitStreamer(TwythonStreamer):
def on_success(self, data):
if 'text' in data:
# skip retweets
if data['text'].startswith('RT'):
# skip own tweets/DMs
if data['user']['screen_name'] == MY_HANDLE:
elif '@' + MY_HANDLE in data['text'].lower():
#print("Mention received")
utterance = ' '.join(w for w in data['text'].split() if not exclude_word(w)) + ", you piece of shit."
def on_error(self, status_code, data):
shitstream = ShitStreamer(api_key, api_secret, access_token, access_token_secret)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment