Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A demonstration message publisher for Printer (http://printer.gofreerange.com)

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 views
Octocat-spinner-32 .foreman Initial commit. March 26, 2012
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 Procfile
Octocat-spinner-32 README.md
Octocat-spinner-32 app.rb Heroku don't use shared databases anymore. October 31, 2012
Octocat-spinner-32 config.ru
README.md

Printer Mail

A very simple message application demonstrating how to work with the Printer API.

Find out more about printers.

Getting started

This application expects to run on Ruby 1.9.2 or greater.

First, install all the dependencies:

$ bundle install
$ bundle exec foreman start

To use this, a printer owner must visit http://localhost:4545/register (or whatever host the application is deployed to). On that page, they should enter a nickname, and the URL endpoint for their printer. For example, the nickname could be lazyatom, and the printer URL may be something like http://printer.backend.server/print/abcd1234efgh5678.

Then, they can share the url http://localhost:4545/send/lazyatom (or whatever the nickname was) with their friends.

Those friends with the URL can send messages to the printer by completing the "From" and "Message" fields, and hitting "Send"; the message will be printed out on the recipient's printer shortly afterwards.

How it works

The Printer ecosystem works by content sources (like this app) sending URLs to a printer URL, which is provided by a printer backend server. The Printer backend then requests the page at that URL, renders it and makes it available for the printer identified by that URL.

In this case, when a message is created, a URL of the form http://localhost:4545/messages/:id is sent to the backend when a message is created.

This page is styled using the default print stylesheet from http://printer.exciting.io, which helps ensure that the layout will work well on the fixed, small width of the printer (384px).

More background

Why do I have to enter a printer URL?

Well, the idea is that printers don't all need to be connected to a single central backend server. You can run your own Printer backend server for yourself, or for you and your friends. Or you could run your own backend server behind your firewall. Or you can use a hosted one, like the original server at http://printer.exciting.io. It's up to you.

Similarly, many different publishers can be used to send content to a single printer. This demonstration "message" service isn't tied to any single backend, and you can run your own instance of this publisher yourself too if you like.

Something went wrong with that request. Please try again.