Sunday, February 2, 2014

Starting off

Tomer and I are working on a project that will take Twitter feeds and extract event information from them.

We decided to use one of many existing Twitter API wrappers for python, this one called python-twitter: https://github.com/bear/python-twitter

The instructions described installation using pip, which I've heard of before. I decided to suck it up and go through linux-installing-stuff hell and see how it went. As a side note, I'm using UCLA's SEAS linux server, so I don't have admin privileges to install whatever I want wherever I want. This is a good restriction and provides a nice learning opportunity about using linux systems the right way.

I downloaded pip from here: https://pypi.python.org/pypi/pip#downloads . Because I couldn't just install pip on the global packages location, I had to install it in my local user account. This article helped explain it, particularly the section about using the --user option: http://docs.python.org/2/install/

I think the command I ran was something like this (in the pip folder):

python setup.py install --user

(I might have had to build first, python setup.py build)

It put itself in my home directory, under .local/bin. I added this to my path in my .profile file.

export PATH=~/.local/bin/:$PATH

I was able to run the instructions on python-twitter's page, which talked about installing the necessary software using a requirements.txt file. When doing this, I also added the --user option.

Finally, I built and installed python-twitter, using the --user option of course.

I ran both the test scripts. Most of the tests seem to output an ERROR or FAIL. One test does seem to pass, namely GetStatus. Test also takes over 6 minutes.

In addition, I'm unable to follow the simple API calls. I'm getting errors that read "AttributeError: 'Api' object has no attribute '_Api__auth'. Do I need to enter some credentials before using this?

No comments:

Post a Comment