Using Twitter-bots as a democracy tool
By Karlheinz Niebuhr, follow me on twitter, and github
Background information: On Thursday morning 04.06.15 the Paraguayan Senate defeated a mandatory data retention bill that would have compelled local ISPs to retain communications and location details of every user for a period of 12 months.[1] ###Introduction A key tool which was used by Paraguayans to fight the data retention law is a python script named “Pyrawebs”. The name of the Tool which sends automated tweets to the Paraguayan politicians, alludes to the digital version of pyragües, informers who monitored the civilian population’s movements on behalf of dictator Alfredo Stroessner, who ruled between 1954 and 1989. In this post I will explain how this script works and how it was used. Hopefully someone else can give it a meaningful use.
###How it works
The tools which is written in python by Juan and Marce uses the tweepy library to communicate with the twitter API. It can be executed via the command line and takes as input the names of two text files. One of them a list of Twitter users and the other one is the file which contains a list of all the tweets you want to send. IMAGES It iterates over every tweet and sends them to every single user contained in the users text file.
###Evading spam patrol One of the issues we encountered was an error message after a number of consecutive tweets.
“This request looks like it might be automated. To protect our users from spam and other malicious activity, we can’t complete this action right now. Please try again later.”
Apparently the twitter API wasn’t amused.
Fortunately I could solve this by rising the inferior time limit of the random time function. The twitter API gets suspicious if there are several new tweets in a short time period (Twitter engineers if you are reading this, don’t update your code.) And that’s it, now you can deliver meaningful tweets 24/7.
Cheers
I’ll post the main code below, for more details check it out on Github
pyrawebs.py
key file key.py
list of target twitter accounts.. insert as many as you like
list of tweets.. you can insert as many as you like
Check out the code and tutorial on Github
Resources:
[1] https://www.eff.org/deeplinks/2015/06/turning-tide-against-online-spying-paraguay
Comments