Twitter Trading – Getting tweetstream working on GoDaddy

In python code was provided for downloading tweets. The python tweetsteam library was used because python is more compatible than R when using cheap webhosting.

The hosting provider for this site is GoDaddy, they provide python 2.4 and python 2.7 on their basic economy web hosting package. Tweetstream is only compatible with python 2.6 and upwards.

Unfortunately the GoDaddy python 2.7 wasn’t built using the enable ssl options, thus communication over HTTPS which the twitter API requires isn’t possible. Fortunatly I have been able to find a solution which is discussed in this post.

Installing python over SSH and the commandline is normally a straight forward task but since I don’t have root access and there are no compilers available the problem is tricky to solve.

Fortunately it is possible to download pre-compiled python binaries and install them in a folder where I have read/write access. The prebuilt binaries can be found at

wget tar -zxvf ActivePython- cd ActivePython- ./
-bash-3.2$ ./
Enter directory in which to install ActivePython. Leave blank and
press 'Enter' to use the default [/opt/ActivePython-2.7].
Install directory: ~/ActivePython
Installing ActivePython to '/var/chroot/home/content/92/9339192/ActivePython'...
Relocating dir-dependent files...
Pre-compiling .py files in the standard library...
ActivePython has been successfully installed to:
You can add the following to your .bashrc (or equivalent)
to put ActivePython on your PATH:
export PATH=/var/chroot/home/content/92/9339192/ActivePython/bin:$PATH
The documentation is available here:
Please send us any feedback you might have or log bugs here:
Thank you for using ActivePython.
export PATH=~/ActivePython/bin:$PATH
-bash-3.2$ python2.7 ActivePython (ActiveState Software Inc.) based on
It should say ACTIVE PYTHON above if install was successful
Python 2.7.2 (default, Jun 24 2011, 09:10:09)
[GCC 4.0.2 20051125 (Red Hat 4.0.2-8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.ssl
<function ssl at 0xb7f21ae4>
The above would have throw an error if ssl not installed 
-bash-3.2$ pip install tweetstream
Downloading/unpacking tweetstream
 Downloading tweetstream-1.1.1.tar.gz
 Running egg_info for package tweetstream
Downloading/unpacking anyjson (from tweetstream)
 Downloading anyjson-0.3.1.tar.gz
 Running egg_info for package anyjson
Installing collected packages: tweetstream, anyjson
 Running install for tweetstream
Running install for anyjson
Successfully installed tweetstream anyjson
Cleaning up...
-bash-3.2$ python
1 ( 0 tweets/sec). FinancialBin : Global stocks fall 5th day, Brent off 2 percent on euro zone fears: NEW YORK (Reuters) - World stocks fell for a...
2 ( 0 tweets/sec). stocksgame : Global stocks fall 5th day, Brent off 2 percent on euro zone fears: NEW YORK (Reuters) - World stocks fell for a...
3 ( 0 tweets/sec). Daily_Finances : #News Global stocks fall 5th day, Brent off 2 percent on euro zone fears
4 ( 0 tweets/sec). AUTSmallBiz : [Sydney Morng Hrld] Stocks set to tumble
5 ( 0 tweets/sec). BeckaDerrick : @MattoneAwang it's the same price to finance a brand new mini + get free insurance as it is to insure an old car #WhyIsEveryonePuttingMeOff!




One thought on “Twitter Trading – Getting tweetstream working on GoDaddy

  1. GoDaddy have contacted me since this post, they have recompiled and updated all their servers with python 2.7 built with SSL support. This makes this tutorial somewhat redundant now although it may be useful for other webhosts.

Leave a Reply

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