Skip to content
GitHub Data Challenge experiment with Adafruit Thermo Printer
JavaScript Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
bin
lib
views
.gitignore
Gemfile
LICENSE
README.md
Rakefile
le_github.gemspec

README.md

Le Github : a daily newspaper with Github Data

Success!!! finished 3rd on Github Data Challenge

Requirements

gem install le_github

Howto

Just one command, every morning before breakfast:

le_github

Workflow

Workflow diagram

Arduino programming

You'll need an Arduino for this setup, it'll just be used as a passthrough to your a2_printer.

To do so:

  • Connect your a2_printer rx/tx wires to your arduino rx/tx pins (usually, digital pins 0 and 1)
  • program your arduino with an empty sketch
  • now, reading and writing on usb device from your host will go through your arduino to speak with your a2_printer

Data import

Instead of using directly Google BigQuery, LeGithubImporter is fetching its data from Github Archive website to build a large json of the last day, and to map it to something way lighter for later display in views/index.html

Page Layout

views/index.html is designed using Foundation prototyping framework from Zurb

Webpage scraping

Discovered in Freerange Printer project, you can use PhantomJS to render a webpage in an image file:

phantomjs --local-to-remote-url-access=yes rasterize.js YYYY-MM-DD /tmp/output.jpg

Image printing

a2_printer lib can be used to send the rendered image file to the thermo-printer:

require 'rubygems'
require 'a2_printer'

serial = SerialConnection.new
printer = A2Printer.new serial

printer.begin
printer.set_default
printer.print_image("/tmp/output.jpg")

LeGithubPrinter allows to split the image file to inject because only 384x384 pixels image are currently accepted in a2_printer lib

Result

Edition du 20/05/2012

on paper

Something went wrong with that request. Please try again.