I am using Python-twitter Arduino to turn on a light on the Arduino board when someones does a mention to an specific user in twitter. I am able to do turn on the light if I use my username and use the this status = api.GetUserTimeline('username') I would prefer that when someones mentions the username anywhere in twitter this lights turns on. Any ideas how I can I do this?
Below is an example of the code.
#status = api.GetUserTimeline('username') ##grab latest statuses
status = api.GetMentions(count=1) ##How get this to work properly?
checkIt = [s.text for s in status] ##put status in an array
drip = checkIt[0].split() ##split first tweet into words
## check for match and write to serial if match
if drip[0] == '#action_go':
print 'Tweet Recieved, Turning the light on!'
ser.write('1')
elif drip[0] == '#action_stop': ##break if done
ser.write('0')
print 'stopped, awaiting instructions.'
else:
ser.write('0')
print 'Awaiting Tweet'