@riverfox/webring

0.0.1 • Public • Published

WebRing

This script provides a simple webring navigation script. A webring is a collection of websites linked together in a circular structure, allowing users to navigate from one site to the next, promoting discovery and traffic among sites, usually sharing a common theme.

Features

  • Supports multiple webrings.
  • Allows navigation to the next, previous, and a random site within the webring.

Webring Structure (webrings.json)

The webrings.json file should contain a JSON object where each key represents the name of a webring, and its value is an array of websites part of that webring. Websites should be specified by their URL strings.

{
  "tech": [
    "http://example1.com",
    "https://example2.com"
  ],
  "art": [
    "https://example3.com",
    "http://example4.com"
  ]
}

.env Parameters

  • PORT: The port on which your server will run. Defaults to 3000 if not specified.
  • WEBRINGS_JSON: The file path to your webrings.json, defining the structure of your webrings.
  • WEBRINGS_CACHE_MINUTES: Read the webrings.json once in X minutes.

URL Formats

Members of a webring should implement navigation by creating links to the endpoints provided by this script. Use the following URL formats to navigate within your webring:

  • Next Site: /webring/<webring_name>/next?from=current_site_url
  • Previous Site: /webring/<webring_name>/previous?from=current_site_url
  • Random Site: /webring/<webring_name>/random

Replace <webring_name> with the name of your webring and current_site_url with the URL of the current site the user is visiting.

Usage

  1. Ensure you have Node.js and npm installed.
  2. Set up your webrings.json with the structure of your webrings.
  3. Configure the .env file with your preferred PORT and the path to your webrings.json.
  4. Start the server with npm run start.
  5. Add navigation links on webring websites as described in the URL Formats section.

Readme

Keywords

none

Package Sidebar

Install

npm i @riverfox/webring

Weekly Downloads

1

Version

0.0.1

License

AGPL-3.0-or-later

Unpacked Size

48 kB

Total Files

18

Last publish

Collaborators

  • object-required