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.
- Examples
- Features
- Rationale
- Use Instructions
- Installation
- Testing
- Limitations
- Technologies
- Miscellaneous
- 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
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.
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.
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.
This part assumes the requirements have been fulfilled.
- Click the green
Code
button on the project's GitHub repository page and download the project as a ZIP file - Unzip the file
- Open your system's terminal
- 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'slib
folder - 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.
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.
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 used for this project include:
- Node.js as a runtime environment
- npm for package management
- Jest for testing
- webpack for bundling
- Visual Studio Code for development
npm install
- installs the required packages for the projectnpm run build
- updates bundle.js to use the latest versions of the replace4chanLinks.js and siteAndBoardRegexes.js files. index.html will use the updated version of bundle.jsnpm test
- runs the tests for the project with Jest