Fork me on GitHub

Tweeting, hacker style

by Elliott Hauser

28 Mar 2014

From your Nitrous box, clone the repo and install twython

git clone https://github.com/silshack/tweethack.git
pip install --user twython

Then:

  • Create a creds.py file and put in the keys I'll give you in class.
  • Run setup.py. You can either be logged in to your personal twitter account or the class account.
  • Run tweethack.py

Make sure to cd into the directory before you try to run the programs.

What to turn in:

A pull requested post with a command line tweet you made embedded in it.

Extra credit: make your own twitter app.

Sign up at developer.twitter.com. Make an app: make app

You'll find your own secrets: secrets

Get write access: read and write

Link your own twitter account: access token

For this extra credit, turn in a post detailing how I can tweet from your app. I'll need access to your secret keys and it's very important to not commit them to a github repo. .gitignore any files containing secrets the way we've done in class.

Elliott Hauser is a PhD Student in information science at UNC Chapel Hill. He's hacking education as one of the cofounders of Trinket.io. Find Elliott Hauser on Twitter, Github, and on the web.
comments powered by Disqus