Blinkt! twitter_monitor.py example help


#1

Hi all.
I was trying to run one of the Pimoroni supplied python examples called twitter_monitor.py but I’m afraid I have zero knowledge about what I need to enter to get it working. It describes something about twitter developer access tokens and secrets, but that may as well be written in Klingon for all the sens it makes!

Anyone out there give me a hand on what I need to change to the script to get it working?

thanks.


#2

for some reason you must have your phone number added to your twitter account to create a token so best add that first

then if you login with your twitter account here: https://apps.twitter.com/ and click create an application you can fill out the form

just give it any name / description you like and ideally point the url at a domain you own, accept the terms and click submit.

you should now see your twitter ‘app’ settings and you will be able to generate your access token by clicking the generate access token button on the keys and access tokens tab.

edit the twitter_monitor.py script and add the tokens as needed at the top and it should work.


#3

If you plug in your access credentials (all four fields) into the sample code and stick to one hashtag for the time being then the example will run without further modification. Let me know if you run into issues AFTER you have pasted your access credentials and I’ll try to help you out. I’ve run all but two of the standard Pimoroni supplied examples without any error/issue.

Regards.

P.S. Of course, I have my own issue with respect to processing the matching tweets but that is a separate thread.