With the Python program (see part 1 and part 2) collecting Tweets from Twitter and then analysing the data via Azure to see if the sentiment is positive, neutral or negative it only means I am one step away from being able to retweet positive tweets. I’ve reused some of the code from my earlier Twitter Tweet bot (which currently automatically tweets the temperature of a room) and at regular intervals the Twitter Bot automatically retweets tweets that contain “geektechstuff” and are (according to Azure) positive in sentiment.
I’m running the code automatically at regular intervals on my Raspberry Pi using a Cron job. One note; I hit an issue originally on my Pi as I had not updated the Python Twython module and I had to adjust the text file to the complete file path and name (rather than just the name) as otherwise Cron had issues running the Python code. If Cron is not auto running the Python program for you then I recommend opening the Pi’s Terminal and using the command:
grep CRON /var/log/syslog