- Create a Twitter App - apps.twitter.com
- Add your credentials to creds_DEMO.json, save the file, then rename it
creds.json
- DON'T COMMIT YOUR CREDENTIALS THEY ALLOW ACCESS TO YOUR TWITTER ACCOUNT - Edit the base tweets in save_healthcare.py and add more if you want.
- Start sending tweets:
python save_healthcare.py
On Mac you can schedule a tweet to Republican senators every two minutes like this:
git clone https://github.com/fernando-mc/save-healthcare.git
brew install watch && watch -n120 "python save_healthcare.py"
First - Search your Mac Programs
Next - Open the Terminal
application
Last - Copy and paste in this command. The detailed command is explained below for the reasonably suspicous:
cd ~/Desktop && \
xcode-select --install && \
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" && \
brew install python && pip install virtualenv && \
virtualenv env && source env/bin/activate \
&& pip install Twython && brew install git && \
git clone https://github.com/fernando-mc/save-healthcare.git && \
open -a TextEdit ./creds.json && open https://apps.twitter.com/
&&
chains things together to run them one after anothercd ~/Desktop
Changes the referenced directory to your desktopxcode-select --install
Installs needed developer tools&& ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Installs a tool called Homebrew which let's us - more easily get all our dependencies.brew install python
Gets the python programming languagepip install virtualenv
Gets the virtualenv package for installing python - dependenciesvirtualenv env && source env/bin/activate
Creates and activates a - virtual environment to install Python dependencies.pip install Twython
A dependency for dealing with the Twitter APIbrew install git
A dependency for copying some code to run the save - healthcare scriptgit clone https://github.com/fernando-mc/save-healthcare.git
Us actually - getting the code we're runningopen -a TextEdit ./creds.json && open https://apps.twitter.com/
Opens the Twitter apps homepage to create an app and the credentials file you'll - need to update to run the script