2021-07-14 Jupiter and Gemini

Jupiter is my “river of news” style feed aggregator, ostensibly for the web. But I just tried the following: you can provide it with a HTML template to use; and nothing prevents you from generating gemtext in that template!

This could be the “alex-gemini.html” template. Unfortunately, the “.html” extension is mandatory for both the file to generate and for the template to use.

% my ($globals, $feeds, $entries) = @_;
# Alex’ Reading List
% my $day = "";
% for my $entry (@$entries) {
%   $day = $entry->{day};
> <%= $entry->{excerpt} %>
=> <%= $entry->{link} %> <%= $entry->{day} %> <%= $entry->{blog_title} %> — <%= $entry->{title} %>
%   if ($entry->{categories}) {
Tags: <%= join ' ', map { "#$_" } (@{$entry->{categories}}); %>
%   }
% }

But no big deal, we can fix this by simply renaming the result. The arguments for a Jupiter call if you’re not taking the defaults are: “html” to generate the HTML, “index.html“ for the HTML file to generate (which is going to contain the resulting gemtext), “gemini-template.html” is the template above, and “alex.opml“ with the OPML listing all the feeds I care about. Once we’re done we can delete the generated feed “feed.xml” since we don’t care. I guess if we wanted to, we could also write a template for a Gemini-aware Atom feed and generate that, but this is just a demonstration.

jupiter html index.html gemini-template.html alex.opml \
&& mv index.html ~/alexschroeder.ch/blogs/index.gmi \
&& rm feed.xml

I guess I should get rid of the named entities, and the HTML spans in the excerpts, haha.

Well, I don’t think I’ll be using it in any case, since I’m using moku pona to generate Gemini documents based on the feeds.

Like this one:

It works.


Please make sure you contribute only your own work, or work licensed under the GNU Free Documentation License. Note: in order to facilitate peer review and fight vandalism, we will store your IP number for a number of days. See Privacy Policy for more information. See Info for text formatting rules. You can edit the comment page if you need to fix typos. You can subscribe to new comments by email without leaving a comment.

To save this page you must answer this question:

Just say HELLO