Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Mastodot
out
done
tmp

# Logs
logs
*.log
Expand Down
29 changes: 25 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# printer
# Mastodot - Mastodon on a Dot Matrix Printer

Printer example.
This is being made as an installation for [Electromagnetic Field Festival](https://emfcamp.org)

## Usage

Expand All @@ -10,8 +10,29 @@ You'll need to install the dependencies first:
npm install
```

Then compile and run the program with:
Then compile and run the two programs at the same time in two terminals:

```bash
npm run start
npm run mastodot
```

```bash
npm run mastoprint
```
## How it Works

- Mastodot
- connects to the mastodon streaming api
- saves all received toot objects as json files in the out folder.
- Mastoprint
- connects to the printer
- goes through each toot json in the out folder
- formats the toot with ESC/P commands
- sends the formatted toot to the printer
- moves the now-printed toot json file to the done folder

These have been separated as the toots can come in way faster than the printer can print them.

We're accessing the printer directly with ESC/P -- It doesn't have a queue. If you try to print while something else is trying to print, it errors.

So Mastoprint acts as the print queue.
49 changes: 0 additions & 49 deletions index.ts

This file was deleted.

Loading