Skip to content

Functions to replace dead 4chan and 4chan archive links with live ones. Contains regular expressions for 4chan archive sites and boards.

License

Notifications You must be signed in to change notification settings

bzvnr/4chan-Link-Updater

Repository files navigation

This project contains functions to automatically update dead 4chan and 4chan archive links with live ones. It also contains regular expressions to match 4chan and 4chan archive sites with their respective boards.

If viewing this project on npmjs.com, the GitHub repository may have a more recent version.

Table of Contents

Examples

Before After
https://boards.4channel.org/lit/thread/20169681/what-edition-of-hamlet-should-i-get#p20169912 https://warosu.org/lit/thread/20169681#q20169912
https://yuki.la/s4s/thread/7838249/cowe/7839030 https://archive.4plebs.org/s4s/thread/7838249#q7839030

Features

  • Functions to replace post and thread links for 4chan and dead 4chan archives with lives ones automatically
  • Regular expressions for 4chan archive sites and their respective boards

Rationale

Threads on the imageboard 4chan are ephemeral, meaning they become inaccessible after some time. Links to the thread no longer work once a thread becomes inaccessible.

4chan archive sites that preserve threads past their deletion exist, but the 4chan links remain broken. Additionally, 4chan archives can go offline, rendering links to those archives broken.

This project solves that problem by providing functions to replace those broken / dead links with live ones automatically.

Use Instructions

A live version of project can be used with GitHub Pages. The project can also be used offline by downloading or cloning it from GitHub.

Requirements

To use this project locally, Node.js and npm must be installed. See installation instructions for Node.js for details. A short video on how to install Node.js can also be viewed here.

Installation

This part assumes the requirements have been fulfilled.

  1. Click the green Code button on the project's GitHub repository page and download the project as a ZIP file
  2. Unzip the file
  3. Open your system's terminal
  4. In the terminal, navigate to the project's directory (folder). If you are unfamiliar with terminal navigation, enter cd [filePathToProjectDirectory] without the brackets in the terminal (ex: cd C:\Users\user\Downloads\4chan-Link-Updater-master\4chan-Link-Updater-master). The directory navigated to should contain the project's lib folder
  5. In the terminal, enter npm install to download the npm packages required for the project

The project's HTML document opened in most browsers should work locally after these instructions.

Testing

Tests are used to verify this project's functionality (see limitations for tests that don't pass).

To run the tests, in a terminal navigated to the project's directory, run npm install if packages aren't installed, then npm test to run the tests.

Limitations

Image links are currently not supported. To see the links that currently cannot be parsed, view testCases.json and search for "nonFunctional". Note that post and thread links in the format /{threadNumber},{postNumber} are not supported.

There is no safety check for non-functional links. Use with caution.

Technologies

Technologies used for this project include:

Miscellaneous

npm Commands

Resources

About

Functions to replace dead 4chan and 4chan archive links with live ones. Contains regular expressions for 4chan archive sites and boards.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published