0

I want to make a bot that, upon someone mentioning it (@username) in the tweet, it receives all the text from the tweet and looks for 'on' or 'On' or 'off' or 'Off'. I've setup Twython and have it working and I know how to do everything here except recieve the text from a tweet.

TL;DR I want to get text from a tweet with Twython, and I don't know how, please help

1 Answers1

0

If you already have the list of tweets then following might help you.

import re
list = ['This is @brent','This is @alex']
test = re.compile["@alex",re.IGNORECASE)
files = [f for f in list if test.search(f)]
print files
LonelySoul
  • 1,212
  • 5
  • 18
  • 45