Skip to main content

Cool Party Trick: Tweet from the Command Line!

Twitter is one of the most powerful social platforms to tap into because 1) Tweets are concise and standardized, and 2) Tweets are transparent and open for all to access and use. Many companies have developed ways of collecting and analyzing tweets to create useful insights about what is being discussed on Twitter.

I started reading the excellent Mining the Social Web by Matthew Russell published by O’Reilly, one of my favorite publishers of technology books. The book discusses how the incredible social data from Facebook, Twitter, LinkedIn, and other social media sites can be programmatically accessed and harvested for later research and analysis.

(If you are interested, you can follow the author of this book on Twitter @ptwobrussell and @SocialWebMining)


Chapter one discusses how to access Twitter through a command line interface and Python using Mike Cardone’s Python Twitter Tools


After being sure that easy_install was working (and knowing that Python was already running on my Mac OS X laptop), It was easy enough to get PTT installed – using Terminal (the Mac OS X command line terminal emulator), I just typed in:

$ easy_install twitter

Once installed, you can tweet from Terminal with a simple command like:

$ twitter set “Class work day in #unidigadv #blogging #tweeting”

One quick command, and a second later, my tweet was live:

Class work day in #unidigadv #blogging #tweeting
— Matthew Wilson (@cecilkleakins) October 5, 2012


Now that’s a pretty cool party trick, but the real power of accessing data from the social web lies in integrating the Twitter API with a programming languages like Python or Ruby to gather, analyze, and visualize the data in interesting ways.


If you’re interested in learning more, check out this book – or its companion volume, 21 Recipes for Mining Twitter.

Matthew Wilson

Matthew Wilson is an Instructor in Marketing at the University of Northern Iowa. Matthew teaches courses in Digital Advertising, Advertising Campaign Development, and Experiential Marketing. He is passionate about the Interactive Digital Studies program at UNI and is also the faculty advisor for AAF-UNI, the college chapter of the American Advertising Federation. Matthew is a creative director with 18 years of experience working in advertising, interactive design, video production and experience design.

Leave a Reply

Your email address will not be published. Required fields are marked *