TRMNL-Farside is a small Go service that scrapes the daily comic from https://www.thefarside.com/ and returns JSON for a TRMNL Private Plugin.
The endpoint returns JSON shaped like:
{
"img": "https://featureassets.amuniversal.com/assets/...",
"imageUrl": "https://featureassets.amuniversal.com/assets/...",
"title": "Comic caption or alt text"
}Use img in your TRMNL markup.
- Install Go: https://golang.org/doc/install
- Clone this repository and move into the project folder.
- Initialize modules (first time only):
go mod init farside_go
- Install dependencies:
go get github.com/PuerkitoBio/goquery go mod tidy
- Run the server:
go run main.go
- Expose the server publicly on port
8123.
- Log in to TRMNL and open Plugins.
- Open Private Plugin and click Add new.
- Name your plugin (for example, Daily Comic).
- In Strategy, choose Polling.
- Set Polling URL to your server URL.
- Save once so Edit Markup becomes available.
Paste this into Edit Markup:
<div class="view comic-view bg-white">
<div class="layout layout--col gap--space-between">
<div class="columns">
<div class="column">
<div class="content content" style="max-height: 95hv">
<img src="{{ img }}" alt="{{ title }}" style="display: block; margin: 0 auto; max-width: 80%; height: 350px; border-radius: 5px;" />
<p style="text-align:center">{{ title }}</p>
</div>
</div>
</div>
</div>
<div class="title_bar">
<img class="image" src="https://siteassets.thefarside.com/packs/media/images/brand/logo/tfs_logo-cb7a52999a9300e203e36865dc428f71.svg" alt="The Far Side by Gary Larson" />
</div>
</div>- Save the plugin.
- Open Playlists in TRMNL.
- Move the plugin to the desired position.
- Refresh your TRMNL device to view the daily comic.
This project is licensed under GPL-3.0. See LICENSE.
