Read from USB HID Keyboard device, line by line, HTTP POST to server

I have a barcode scanner connected to a BeagleBone. The scanner acts similarly to a keyboard, in that, the barcodes it scans are output as keypresses. My goal is to write a bash script (or ruby or python app) that starts up with the OS, reads data from this USB keyboard device, does some minimal parsing of the output, and POSTs this data to a webserver (curl or net/http or urllib2).

OS info:

$ lsb_release -irc Distributor ID: Debian Release: 8.3 Codename: jessie

I can read the output of the barcode scanner a couple of different ways.

Using cat:

$ cat /dev/input/event1 | hexdump

Using evtest:

`
$ apt-get update
$ apt-get install evtest

$ evtest /dev/input/event1

`

The output of both of these processes seems very low-level. I wonder if I’m even approaching this the right way.

Any help or guidance would be greatly appreciated.