pages.tsv 中列舉了所有頁面
- main branch - 放置文件與網站 archive 的相關 script
- gh-pages branch - 靜態化網站完整頁面與檔案
約 70GB(含 .git);純靜態檔案約 36GB
約 36GB
➜ brew install git-lfs # mac brew 安裝 git LFS (其他作業系統參考: https://github.com/git-lfs/git-lfs#installing)
➜ git lfs install # 初始化 LFS
➜ git clone --single-branch -b gh-pages https://github.com/ocftw/openfoundry.org.git # 下載 gh-pages branch- 在 mac 上安裝 httrack
➜ ~ brew install httrack- 建立基礎鏡像
./httrack.sh- binary 檔案的擷取策略
- 先只抓 html 網頁
- 接著再從 hts-cache/new.txt 中列舉 binary 檔案
- sftp 進去主機找該檔案,下載後置入,於 httrack.sh 手動排除該路徑
- 再用 httrack_url_list.sh 抓取其餘的 binary 檔案
/archived/*.zip
/wsw/dmdocuments/*.pdf
/of/MOST/103/*.pdf
/of/MOST/102_testing/*.pdf
/of/nsc_upload_dir/*.pdf
/of/public/tmp/nsc101-20130618/*.pdf
/of/public/download/* (120GB, 暫且不抓) //FIXME
請參考 commit history - main branch、gh-pages branch
- 使用
page_search_to_list.sh搜尋問題頁面(如 "Page not found") - 使用
files_to_urls.sh將檔案路徑轉換為 URL - 使用
extract_media.sh提取多媒體檔案清單 - 使用
httrack_url_list.sh抓取清單列出的 URL 目標
- 再次列出所有的頁面目錄與標題清單
- 檔案下載的頁面中的檔案加上連結
- 刪掉「Search Keyword xxx Total: 1 results found.」頁面
- 重新下載 *.tmp 檔案
- 重新下載 *.delayed 檔案
- 刪掉所有內容不是 html 的 .html 檔案
- 加入 script 把 github lfs 管理的檔案動態指向 github repo
- 把 binary 檔案都重搬到 LFS 上
- 列出所有的頁面目錄與標題清單
- 設定 git-pages repo 並將 /openfoundry.org/openfoundry.org 搬移到根目錄下以便打開 github pages
- 刪除 <title>40x 的 HTML 檔案
- 下載 to_be_download_url.txt 的檔案
- 移除「Please log in or register to view or modify your profile.」的頁面
- 下載 binary_list.txt 的檔案
- 刪除沒有附檔名,但是有同名 .html 檔案的檔案
- 排除的 of.openfoundry.org 另行處理
- 列出所有的 binary 檔案清單並且抓取
- 列出目前檔案中連結的多媒體檔案清單
- 把所有的 page not found 刪除
- 移除 0 Bytes 的檔案
- 處理
<TITLE>Page has moved</TITLE>的 .html 頁面 - 處理「Click here...」的 html 頁面
- 移除有對應檔案的 0 bytes HTML 檔案
- 列出所有尚未 commit 的檔案清單
- main branch 下的所有檔案以 CC0 釋出至公眾領域。
- gh-pages 內的網頁、影像與多媒體檔案,依循 openfoundry.org 網站授權——除另有註明外,採用 CC BY-NC-ND 4.0 創用CC「姓名標示─非商業性─禁止改作 4.0 國際」授權 及其後續版本授權釋出,請標明著作智慧財產權屬於中央研究院。