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.
- Supports multiple webrings.
- Allows navigation to the next, previous, and a random site within the webring.
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"
]
}
-
PORT
: The port on which your server will run. Defaults to3000
if not specified. -
WEBRINGS_JSON
: The file path to yourwebrings.json
, defining the structure of your webrings. -
WEBRINGS_CACHE_MINUTES
: Read thewebrings.json
once in X minutes.
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.
- Ensure you have Node.js and npm installed.
- Set up your
webrings.json
with the structure of your webrings. - Configure the
.env
file with your preferredPORT
and the path to yourwebrings.json
. - Start the server with
npm run start
. - Add navigation links on webring websites as described in the URL Formats section.