TweetCoding: Display tweets embedded in coding form for analysis

TweetCoding is a tool for simple coding of tweets. It displays 5 tweets per page using Twitter’s tweet embedding to display each tweet as it looks on the Twitter website on a local web page. It needs internet access to get the tweets from Twitter, but all coding data is stored on your computer, not the internet.

Shows top of screen with Load New Dataset and Save Coding Data buttons and first two tweets with coding options
Tweet Coding Screen

The page has form elements for coding each tweet as yes/no/not coded and a comment field for notes.

The first step is to put the list of tweet-id’s for the tweets you want to study into the
“Tweet ID editor” section of the form. The page will refresh with the first 5 tweets showing and buttons to move between pages. As you progress the coding is saved locally using browser data storage. The coding data can be exported at any time as a comma delimited (csv) file by using the “Export data” option.

The local browser storage can be reset back to the default Donald Trump example tweet set at any time by pressing “Reset”.

This is a open source application that runs locally in your browser and displays embedded tweets so they can be coded as “True”, “False”, “unknown” and notes recorded against each tweet. To use the app open index.html in the dist directory. By default a sample dataset of Donald Trump tweets (sourced from https://archive.org/details/trump-tweet-ids) is displayed.

Instructions from READ.ME file:

To show your own dataset, open the Tweet ID editor dropdown and replace the default tweet ids with your own tweet ids – one per line. The Tweet ID editor can then be minimised to give more screen space for coding.

Your coding will be saved on your local disk and persists between sessions.

You can use the reset button to remove any previous coding.

The coding can be exported to a CSV file by using the Save Data (CSV) link.

Citing

If you use this tool in your research please cite it as

Brenda Moon (2017) tweet-coding 1.0: DOI

Development

To contribute to the development of this tool you need to have Node.js installed. It is available here: https://nodejs.org/en/download/ (this will also install npm)

I welcome pull requests and reporting of problems via GitHub issues.

To run in development mode:

npm install
npm run watch

To build for distribution:

npm run build:dist

PhD Completed

It is my pleasure to advise you that on 18 April 2016 the relevant Delegated Authority of the ANU
Colleges of Science confirmed the approval of the award of your degree of Doctor of Philosophy.
Congratulations on this significant achievement.

My thesis is available in the ANU Open access thesis collection: http://hdl.handle.net/1885/101191

Two printed copies of my thesis, one for ANU library and one for the CPAS library.

Brenda Moon bound thesis

 

Getting started with Python 3 & virtual environments on OS X Yosemite

Notes on installing Python 3, virtualenv and virtualenvwrapper on OS X Yosemite. (also shared on QUTPy GitHub repository)

Start by installing XCode from the Apple App store. The latest version (6.4) seems to include command line tools (these used to have to be installed separately).

Create a ~/.bash_profile file to set the architecture type:

# Set architecture flags
export ARCHFLAGS="-arch x86_64"
test -f ~/.bashrc && source ~/.bashrc

On OSX one way to install python3 is to install Homebrew and use

brew install python3

If you don’t want to use Homebrew, you can go to https://www.python.org/downloads/ and download the latest python3 from there.

I use virtual environments with Python to manage dependencies, so the next step is to install that (using pip3 makes sure you are using python3):

pip3 install virtualenv

Virtualenvwrapper makes using virtualenv much easier:

pip3 install virtualenvwrapper

Make directories for your projects and virtualenvs if they don’t already exist (by default virtualenvwrapper will use ~/.virtualenvs)

mkdir -p ~/Projects ~/Virtualenvs

Use which python3  to find out where your python3 is so you can set it in .bashrc.

Create a ~/.bashrc file to set parameters for virtualenvwrapper:

# pip should only run if there is a virtualenv currently activated
export PIP_REQUIRE_VIRTUALENV=true
# set paths to python & directories
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
export WORKON_HOME=$HOME/Virtualenvs
export PROJECT_HOME=$HOME/Projects
source /usr/local/bin/virtualenvwrapper.sh

By setting PIP_REQUIRE_VIRTUALENV=true it prevents pip from running outside of a virtualenv – this might not suit you if you already have work using the systemwide python environment, but is a way to ‘force’ using virtualenv.

Make your first virtualenv:

mkproject test1

This will create the ~/Projects/test1 directory and setup the python libraries for that virtualenv in ~/Virtualenvs/test1. It uses python3 because we set the VIRTUALENVWRAPPER_PYTHON to python3. You can use a command line option to change the python version.

Virtualenvwrapper also activates that virtual environment when you create it. To leave the virtualenv use:

deactivate

To get back into the virtualenv use:

workon test1

workon allows tab completion to see the available environments.

When the virtualenv is active, anything you pip install will be installed just for that virtualenv, not system wide. Once in the virtualenv, the environment is set to the python version you are using, so you can use either pip3 or pip.

See the virtualenvwrapper documentation for other commands to manage your virtual environments.

Try out Jupyter and Pandas

If you want to get started with Jupyter and Pandas you can just install them in your new virtualenv project (this will also install quite a few extra modules that these require):

pip install jupyter
pip install pandas

Start jupyter using:

jupyter notebook