Make Wayback Machine snapshots unstoppable by deploying them to NEAR Protocol using web4.
This tool allows you to:
- Download a webpage from the Wayback Machine
- Transform it into a clean, reader-friendly format
- Deploy it to NEAR Protocol as an unstoppable webpage using web4
- Python 3.7+
- Rust and Cargo
- NEAR CLI
- A NEAR account with deployed keys
- Install Python dependencies:
pip install requests beautifulsoup4 readability-lxml
- Install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- Add the WebAssembly target:
rustup target add wasm32-unknown-unknown
- Install NEAR CLI:
npm install -g near-cli
- Clone this repository:
git clone <repository-url>
cd wayback_web4
- Make sure you have a NEAR account and have logged in with NEAR CLI:
near login
- Find a Wayback Machine snapshot URL you want to preserve. It should look like:
https://web.archive.org/web/20230615000000/https://example.com
- Deploy the snapshot to your NEAR account:
python wayback.py "WAYBACK_URL" --wallet your-account.near
For example:
python wayback.py "https://web.archive.org/web/20230615000000/https://example.com" --wallet example.near
- Your site will be available at:
https://example.near.page
To update an existing deployment with a new snapshot:
python wayback.py "NEW_WAYBACK_URL" --wallet your-account.near --update
- Clean, reader-friendly format
- Preserves original content and structure
- Mobile-responsive design
- Sticky navigation banner
- Original Wayback Machine link preserved
- All assets stored on-chain
- Unstoppable hosting via NEAR Protocol
wayback_web4/
├── wayback.py # Main script
├── web4_contract/
│ ├── Cargo.toml # Rust contract config
│ ├── src/
│ │ └── lib.rs # Contract code
│ └── res/ # Generated content directory
└── README.md # This file
- The script downloads the Wayback Machine snapshot
- Cleans and transforms the content into a reader-friendly format
- Stores the content in the
res
directory - Builds and deploys a web4 contract to NEAR Protocol
- Makes the content available through NEAR's web4 gateway
-
Missing Dependencies
pip install -r requirements.txt
-
NEAR CLI Not Found
npm install -g near-cli
-
Rust Build Fails
rustup update rustup target add wasm32-unknown-unknown
-
Permission Denied Make sure you're logged in with NEAR CLI:
near login
If you encounter issues:
- Check that all prerequisites are installed
- Ensure you're logged in to NEAR CLI
- Verify the Wayback Machine URL is valid
- Check the contract deployment logs
MIT License - feel free to use and modify as needed.