Adam Green
Twitter API Consultant

140dev Source Code

Free open source code for Twitter API programming with PHP and MySQL

This is a great starting point for custom Twitter applications. The plugin architecture makes it easy to extend.

The previous post had an overview of my planned enhancements to the streaming API framework. The first step is adding some new tables to the 140dev tweet collection database: collection_words The words in this table will be used to collect matching tweets. We’ll see how to add this to the get_tweets.php script so that the […]


The next few posts will describe a set of enhancements to the streaming API framework that will greatly expand the capabilities of the code for collecting tweets based on keywords. I thought I’d start with an overview of what I want to accomplish: Add a collection_keywords table to the database to hold keywords to be […]


When compiling a list of prospective Twitter leads for any subject area, an obvious approach is to find accounts that tweet about that subject. This can be done with the streaming API or REST API. This still leaves a lot of curating work to select the highest quality accounts from this group. A valuable shortcut […]


I’m a typical programmer when it comes to reading documentation before I try to run someone else’s code. First I try to run the code, then I read the docs. Hey, if I needed clear documentation to get things working, would I have become a Twitter API programmer? Unfortunately, Twitter’s streaming API requires a unique […]


The streaming API is pretty amazing when you start seeing all that free data pouring into a database, but sadly the connection is not completely stable. I typically see a failure at least every couple of months. It’s hard to be sure what causes the failure. It could be the Phirehose library that talks to […]


I’ve been spending the last few days helping people install the latest version of the streaming API framework. This has reminded me of how many moving parts there are, and how this can get in the way of building a mental model of what is actually going on. One of the biggest confusions seems to […]


One of my primary goals for this codebase has always been pedagogical. I thought of it as a set of training wheels for the streaming API. The number of moving parts is so great with the streaming API that getting data flowing from the API to a database using just the official docs is a […]


I’ve been getting emails from people asking for advice on making the switch to the 0.30 version of this code. First of all, there is only one database change that you must make before running the new code. You have to add a new is_rt (tinyint) field to the tweets table  to flag retweets. This […]


When I built the 140dev framework 3 years ago, my goal was to provide a set of training wheels. Coders who were new to the API could get a complete working system in miniature. My emphasis was on simplicity, certainly not production level functionality. Since the Twitter IPO and the $200M acquisition of Topsy, collecting […]


I’ve been building custom Twitter engagement systems for clients since 2009, and now I’ve combined all of my favorite techniques and tools into a new book available on Amazon: Just as with my 140dev Twitter Framework code and my ebooks on topics like OAuth, the code in this book uses PHP and MySQL. It […]

Our work with Twitter and politics has now moved beyond the 2012 election. We just set up a tweet collection database to track the Occupy Wall Street movement. It uses the 140dev framework to collect all tweets containing #ows, #occupy, and #occupywalllstreet. This will be used to document our tools and methodology to automate a […]

Download the latest version of Phirehose

by Adam Green on September 30, 2011

in 140dev Source Code

Twitter has finally converted the Streaming API over to SSL connections only. This means that your copy of the 140dev Framework will stopping connecting until you upgrade to the latest version of the Phirehose library. You can do this in two ways. You can either download the entire 140dev Framework file for the DB Server […]