2018-11-27 Gopher Module

@jynx mentioned a Gopher Atom feed again, and in fact he has had such a feed for his site for quite some time. And now I’m thinking of a gopher module for RSS 2.0 and I started writing up a specification.

@jynx

a specification

I’m adding it to this wiki right now!

If you want to do the same, take a look at the code that generates your feed. Your feed is either a RSS feed, in which case it starts with an *rss* element, or it’s an Atom feed, in which case it starts with a *feed* element.

Basically you want to add the following:

xmlns:gopher="https://communitywiki.org/wiki/Gopher_Module_1.0"

Here’s an example from my site, using RSS 2.0. This is how my feed begins:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="https://alexschroeder.ch/css/alex-2018.css" ?>
<rss version="2.0"
    xmlns:gopher="https://communitywiki.org/wiki/Gopher_Module_1.0"
    xmlns:wiki="http://purl.org/rss/1.0/modules/wiki/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:cc="http://web.resource.org/cc/"
    xmlns:atom="http://www.w3.org/2005/Atom">

The feed contains a *channel* element which remains unchanged and a bunch of *item* elements. These get a new *link* element with the “gopher” prefix I just defined.

Here’s an example from my feed:

<item>
<title>Gopher Module</title>
<link>https://alexschroeder.ch/wiki/2018-11-27_Gopher_Module</link>
<gopher:link>gopher://alexschroeder.ch/12018-11-27_Gopher_Module/menu</gopher:link>
<guid>https://alexschroeder.ch/wiki/2018-11-27_Gopher_Module</guid>
<description>I'm thinking of a gopher module for RSS 2.0 and I started writing up a specification...</description>
<pubDate>Tue, 27 Nov 2018 19:30:08 GMT</pubDate>
<comments>https://alexschroeder.ch/wiki/Comments_on_2018-11-27_Gopher_Module</comments>
<dc:contributor>Alex Schroeder</dc:contributor>
<wiki:status>updated</wiki:status>
<wiki:importance>major</wiki:importance>
<wiki:version>2</wiki:version>
<wiki:history>https://alexschroeder.ch/wiki?action=history;id=2018-11-27_Gopher_Module</wiki:history>
<wiki:diff>https://alexschroeder.ch/wiki?action=browse;diff=1;id=2018-11-27_Gopher_Module</wiki:diff>
<category>Gopher</category>
</item>

Now, if you have an Atom feed, it’s very similar. This time I’m going to use @jynx’s feed as an example.

@jynx

First, he had to add the namespace to the root element. This is how his feed starts:

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"
      xmlns:gopher="https://communitywiki.org/wiki/Gopher_Module_1.0">

And Atom feeds also have a list of items in their feed but now we’re looking for the element called *entry*. See how he added the gopher link:

<entry>
<title># No days off for you </title>
<id>tag:leveck.us,2017-08-10:/phlog/20170810.post</id>
<author><name>Mr. Leveck</name><email>leveck@leveck.us</email></author>
<link rel="alternate" type="text/plain" href="gopher://leveck.us/0/Phlog/20170810.post" />
<gopher:link href="gopher://leveck.us/0/Phlog/20170810.post" />
<updated>2017-08-10T00:00:00Z</updated>
<content type="text">
<![CDATA[<pre># No days off for you

Working a day off today... 74 hours last week, 54 this week, then four days off. I am damn ready to not wake up at 0335.
</pre>]]>
</content>
</entry>

Obviously in his case there’s little incentive to actually use the gopher module as his site doesn’t have any web links! But still, this is how it would work.

​#Gopher

Comments

(Please contact me if you want to remove your comment.)

In a later discussion, @tomasino convinced me, that this was unnecessary: why mix web links and gopher links? If you’re a web person, you want the web links and the HTML content; if you’re a gopher person, you want the gopher links and the text content.

@tomasino

– Alex Schroeder 2018-11-30 21:32 UTC