mirror of
https://github.com/thetechprepper/emcomm-tools-os-community.git
synced 2026-09-17 15:41:44 -04:00
et-mirror - Added a tool to mirror sites for offline viewing. Also added a directory for storing simple textual notes and howto articles
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
# Offline Site Recommendations
|
||||
|
||||
This is a list of online resources that I personally store locally
|
||||
for offline browsing. This list will grow over time.
|
||||
|
||||
Run `et-mirror.sh <start_url>` to mirror the site. For example:
|
||||
|
||||
```
|
||||
et-mirror.sh https://choisser.com/packet/`
|
||||
```
|
||||
|
||||
The above command will mirror the start URL https://choisser.com/packet/
|
||||
along with any pages within the site that it links to.
|
||||
|
||||
The mirrored site will be available in your home directory under the
|
||||
`offline-www` directory. You can open the files using the Min web browser.
|
||||
|
||||
|
||||
## Packet Radio
|
||||
|
||||
* https://choisser.com/packet/
|
||||
* https://www.cantab.net/users/john.wiseman/Documents/
|
||||
* https://soundcardpacket.org/
|
||||
* https://tldp.org/HOWTO/AX25-HOWTO/index.html
|
||||
Executable
+46
@@ -0,0 +1,46 @@
|
||||
#!/bin/bash
|
||||
# Author : Gaston Gonzalez
|
||||
# Date : 29 December 2024
|
||||
# Purpose : Mirrors a website for offline browsing
|
||||
|
||||
ET_OFFLINE_WWW_DIR="${HOME}/offline-www"
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "$(basename $) Usage: $0 <start-url>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -e ${ET_OFFLINE_WWW_DIR} ]; then
|
||||
et-log "Creating offline web directory: ${ET_OFFLINE_WWW_DIR}"
|
||||
mkdir -v ${ET_OFFLINE_WWW_DIR}
|
||||
fi
|
||||
|
||||
START_URL=$1
|
||||
|
||||
# Validate the URL format
|
||||
if ! [[ $START_URL =~ ^https?:// ]]; then
|
||||
echo "Invalid URL. Provide a valid URL that starts with http:// or https://"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DOMAIN_NAME=$(echo "$START_URL" | awk -F[/:] '{print $4}')
|
||||
|
||||
echo "Starting website mirroring..."
|
||||
|
||||
wget --mirror \
|
||||
--convert-links \
|
||||
--adjust-extension \
|
||||
--page-requisites \
|
||||
--no-parent \
|
||||
--directory-prefix="${ET_OFFLINE_WWW_DIR}" \
|
||||
"${START_URL}"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Website mirroring completed successfully."
|
||||
echo "Domain: ${DOMAIN_NAME}"
|
||||
echo "URL: ${START_URL}"
|
||||
echo "Output Directory: ${ET_OFFLINE_WWW_DIR}"
|
||||
else
|
||||
echo "An error occurred while mirroring the website."
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user