Skip to content

ocftw/openfoundry.org

Repository files navigation

OpenFoundry.org 封存

完整頁面清單

pages.tsv 中列舉了所有頁面

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

鏡像網站製作流程

  1. 在 mac 上安裝 httrack
~ brew install httrack
  1. 建立基礎鏡像
./httrack.sh
  1. binary 檔案的擷取策略
  • 先只抓 html 網頁
  • 接著再從 hts-cache/new.txt 中列舉 binary 檔案
  • sftp 進去主機找該檔案,下載後置入,於 httrack.sh 手動排除該路徑
  • 再用 httrack_url_list.sh 抓取其餘的 binary 檔案

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 branchgh-pages branch

  1. 使用 page_search_to_list.sh 搜尋問題頁面(如 "Page not found")
  2. 使用 files_to_urls.sh 將檔案路徑轉換為 URL
  3. 使用 extract_media.sh 提取多媒體檔案清單
  4. 使用 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 的檔案清單

授權

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published