Skip to content
This repository has been archived by the owner. It is now read-only.
Branch: master
Go to file

Latest commit


Failed to load latest commit information.
Latest commit message
Commit time


The most common question we get on this project is how the positive/negative sentiment works, long story short, we tested out various sentiment analysis engines/APIs and found that (not only are they super expensive and over-complicated), that using a simple keyword matching technique worked just as well if not better.

You can see how it works by reviewing the code but there are two short keyword lists for positive and negative respectively, we selected keywords that are commonly used in situations that are definitely positive or negative, eliminating the grey-area keywords that could cause false-positives.

As a final scrub on positive matches we make sure none of the negative keywords are in the positive match, keeping the positive tweets clean.


This project is built with today's common off-the-shelf Maker components, though there are quite a few technologies going-on here so this project makes a great example of marrying them all together.



 * Flag object.
 * @typedef Flag
 * @type {Object}
 * @property {number} position Stepper motor position
 * @property {Object} tweet Twitter's tweet object
 * @property {string} sentiment 'positive' or 'negative'
    position: pos,
    tweet: data,
    sentiment: sentiment


Download the PiHead image, and write the image to your SD card.

For OS X, note the RAW disk device rdisk is much quicker.

sudo dd bs=1m if=path_of_your_image.img of=/dev/rdisk<n>

Or if you already have a system image you want to use you can follow the PiHead steps.

Visit with Chrome, and with your RPi running you should get raspberrypi on the setup page after a minute or so if you're booting for the first time. Create your user, and visit your login page to test-out Headless.

Use the IP address from your login page to SSH into your RPi (password is raspberry).

ssh pi@<ip address>

1 Expand Filesystem, and 16 MB memory split (under 8 Advanced Options > A3 Memory Split) for the GPU.

sudo raspi-config
sudo reboot

Log back into your RPi, update and upgrade.

sudo apt-get update
sudo apt-get -y upgrade
sudo rpi-update
sudo reboot

Log back into your RPi and continue.

sudo apt-get -y install arduino
sudo sh setuptools-0.6c11-py2.7.egg
tar xvzf pyserial-2.7.tar.gz
cd pyserial-2.7
sudo python install
cd ..
tar xvzf nanpy-v0.8.tar.gz
cd nanpy-0.8
sudo python install
cd firmware
export BOARD=uno
make upload
cd ../..
rm setuptools-0.6c11-py2.7.egg
sudo rm -r pyserial*
sudo rm -r nanpy*

Install the scripts.

cd headless-stable/users
ls -l
cd <user>
tar xvzf master.tar.gz --overwrite --strip=3
rm master.tar.gz
cd scripts
chmod +x

Test-out the motor.

./ --steps 200
./ --steps -200
./ --steps 2000
./ --steps -2000

Install express, and twit.

cd ../../..
npm install express
npm install
npm install twit

Return to your login page, before running the scripts you'll need to specify your express and twit configuration, add the following to your Ghost or Shell config. Private keys for Twitter can be obtained from your Twitter Apps.

    "express": {
        "port": 3000
    "twitter": {
        "consumer_key": "<consumer key>",
        "consumer_secret": "<consumer secret>",
        "access_token": "<access token>",
        "access_token_secret": "<access token secret>"

Run the script named raisethepride from your Scripts List. Visit http://<ip address>:3000/ and you should see the #RaiseThePride website running, but without tweets.

Next run the script named pflag. If all works well you should see Log output for the flag Position, Total tweets, Positive/Negative split and a JSON string of the matched tweet.

Return to http://<ip address>:3000/ and you should now see the tweets from your device.





No releases published
You can’t perform that action at this time.