-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from ipfs/fix/build-q1-2020
docs: updated notes on snapshot generation
- Loading branch information
Showing
6 changed files
with
128 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.DS_Store | ||
.cache | ||
*.zim | ||
out | ||
IPFS_PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
# vim: set ts=2 sw=2: | ||
|
||
set -euo pipefail | ||
|
||
# Every Wikipedia version uses different name of the main page | ||
|
||
usage() { | ||
echo "USAGE:" | ||
echo " $0 <lang code>"; | ||
echo "" | ||
exit 2 | ||
} | ||
|
||
if [ -z "${1-}" ]; then | ||
echo "Missing language code" | ||
usage | ||
fi | ||
|
||
MAIN_PAGE=$(curl -Ls -o /dev/null -w %{url_effective} https://${1}.wikipedia.org | cut -d"/" -f5) | ||
echo -n "${MAIN_PAGE}.html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
# vim: set ts=2 sw=2: | ||
|
||
set -euo pipefail | ||
|
||
# Landing pages shipping with ZIM file are either truncated or Kiwix-specific. | ||
# This script finds the URL of original version of the langing page | ||
# mathing the timestamp of snapshot in unpacked ZIM directory | ||
|
||
usage() { | ||
echo "USAGE:" | ||
echo " $0 <main page name> <unpacked zim dir>"; | ||
echo "" | ||
exit 2 | ||
} | ||
|
||
if [ -z "${1-}" ]; then | ||
echo "Missing main page name (eg. Main_Page.html) " | ||
usage | ||
fi | ||
|
||
if [ -z "${2-}" ]; then | ||
echo "Missing unpacked zim dir (eg. ./out) " | ||
usage | ||
fi | ||
|
||
MAIN_PAGE=$1 | ||
ZIM_ROOT=$2 | ||
|
||
SNAPSHOT_URL=$(grep -io 'https://[^"]*oldid=[^"]*' "$ZIM_ROOT/A/$MAIN_PAGE") | ||
|
||
echo $SNAPSHOT_URL |