Code Monkey home page Code Monkey logo

lobstersnntp's Introduction

LobstersNntp

This is an NNTP to Lobsters gateway. It's read-only, but seeing as the Lobsters API is also read-only right now, that doesn't matter.

It's written in Elixir, using Mnesia to store cached messages.

The license is the same as Lobsters itself (3-clause BSD).

This was inspired by Tavis Ormandy's nntpit. I had this idea for a while, but nntpit made it look realistic.

Public instance

If you don't want to set it up yourself, try the public instance, available at nntp.scrollwheel.ca.

I make no guarantees as to of its availability. Caveat emptor.

Running

Make sure you have Elixir installed. As of right now, there is no configuration. The server listens on port 1119. The client information doesn't matter, since you can't post.

$ mix deps.get # get dependencies
$ mix amnesia.create -d LobstersNntp.LobstersMnesia --disk # create tables
$ iex -S mix # start application with REPL attached (compiles if needed)
# Unfortunately you need to manually stir the pot (no background job yet)
iex> LobstersNntp.LobstersClient.update_articles

Tested clients

Fair warning: Most of the clients I tested are GUI ones. I suspect unlike a lot of older TUI ones, they employ different techniques to fetch, and they probably handle HTML news articles better.

  • Outlook Express: works
  • Mozilla (and likely modern Thunderbird): works
  • Netscape 3 & 4: works, doesn't auto-detect UTF-8 messages
  • Xnews: Message display erratic, doesn't support text/html (renders as plain), doesn't support Quoted-Printable subjects
  • Internet News (from Internet Explorer 3): messages blank
  • Agent: works, displays text part of multipart fine, shows HTML as attachment
  • MicroPlanet Gravity: refuses to list the newsgroups

Feel free to try more!

Available groups

  • lobsters: Multipart HTML/Plain UTF-8 QP
  • lobsters.plain: Plain UTF-8 QP

Known issues

  • More DRY
  • The plain text rendering sucks

How does this work?

There's a small server that handles talking to Lobsters. It can be told to go out and fetch the 25 newest posts and their comments.

The data is backed by Mnesia, Erlang's built-in database.

However, we need another server is responsible for taking the data from Mnesia and transforming them into something vaguely mbox-shaped for usenet. I've had a few bugs, so having it in a separate GenServer from the NNTP client is handy!

Article numbering is per-group and annoying. To deal with this, we just have a single group. The lobsters group encapsulates all stories and comments it knows of. Stories have the "fake" newsgroups of lobsters.tag.* to represent any tags.

Lobsters pre-converts Markdown to HTML on endpoints, so we just roll with passing through HTML. This isn't ideal, however.

Most GUI NNTP clients have a flow of:

  • Declare they're a client with MODE READER
  • To get a list of group on request, use LIST or maybe NEWGROUPS
  • NNTP is stateful, so select with GROUP (which also gets you post numbers)
  • Use XOVER on a range of articles in the group, which gets most headers
    • These fall back to XHDR if they can't use XOVER (or just HEAD)
  • Use ARTICLE to select (it's stateful too!) and return headers and body

More could be involved with simplistic clients.

lobstersnntp's People

Contributors

nattynarwhal avatar

Stargazers

Dom Rodriguez avatar w1ntermute avatar Dario Vladović avatar Sergey Karatkevich avatar Daniel Isaksen avatar Mikal avatar Thomas Lindgren avatar  avatar Asherah Connor avatar  avatar Matt Singletary avatar mdheller avatar  avatar  avatar Mark Tearle avatar link2xt avatar Nikita Kretov avatar netop://ウエハ avatar

Watchers

Max Rees avatar  avatar James Cloos avatar  avatar  avatar

lobstersnntp's Issues

XHDR support

This is really more of a generalization of XOVER. See spec. Most clients will try for XOVER then fall back to XHDR, but some clients may try XHDR first and fall back to HEAD.

Schema is ugly

It should be expanded to encompass more fields (i.e authorship), or changed completely (i.e just hold the deserialized JSON).

If so, figure out how Amnesia does migrations so we don't need a flag day.

Subject changes for replies

trn4 works, with some mimetype formatting issues:

image

Followups have a different subject, so they are shown as "Reply to skkda" in the article overview and have a different subject marker ([2]) in the threaded view.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.