dojobo / twally

Rhymes with "tally." Display a tally of streaming tweets on an LED sign.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

twally

Rhymes with "tally." Display a tally of streaming tweets on an LED sign.

Good for trade shows, maker faires, personal affirmation, tweet-offs (are those a thing?), etc.

You tell the script where the Arduino board is located and what terms you want to listen for; the script uses Twitter's streaming API to listen for tweets using those terms and keeps a count; every half-second the script tells the Arduino (via serial connection) what the current count is; the Arduino prints this count to the LED sign.

106 tweets since it started listening

Requirements

After cloning the repo, run: gem install twitter -v 5.14 and gem install rubyserial . The Arduino libraries can be installed from within the Arduino IDE (v1.6.2+) in Sketch > Include Library > Manage Libraries.

Rename credentials_template.yml to credentials.yml and put your twitter keys in there.

Arduino Wiring

See here for how to power and wire the LED matrix. You'll need to have a separate power suppy for the matrix itself. As far as pins go, the guide should steer you exactly right; I've based the display code in this project on their examples.

Once you've got everything wired, you'll plug in the matrix power, plug in the Arduino to a laptop or Pi via USB-B, upload the sketch from the IDE, then start the script with the appropriate parameters.

Usage

ruby twally.rb ARDUINO_LOCATION SEARCH_TERM [SEARCH_TERM2...]

e.g.: ruby twally.rb COM4 friday or ruby twally.rb /dev/ttyUSB1 "dunder mifflin" #paperproducts

Ctrl-C (or ⌘-C) to stop the script while it's running. However, restarting it (without pressing the Arduino's reset button) will both start the count over and do funky things to the numbers on the display. To reset the display to zero, press the physical reset button on the Arduino.

About

Rhymes with "tally." Display a tally of streaming tweets on an LED sign.


Languages

Language:Arduino 67.4%Language:Ruby 32.6%