使用 Twitter 檔案建立 WARC 文件

使用 Twitter 檔案建立 WARC 文件

我下載了一個 Twitter 存檔,其架構如下:

twitter_archive
| assets
+-- fonts (.eot files)
+-- images (icons)
+-- js
| data
+-- various tweet folders containing images
+-- more javascript files
| index.html (launching this brings you to a local webpage in which you 
              can navigate the archive with a Twitter style GUI)

我嘗試過使用瓦西特用於使用存檔並建立可在其中呈現的 WARC 檔案的 Python 套件https://replayweb.page/

我成功建立了 WARC 文件,但當載入到 replayweb.page 時,它指出「此檔案中沒有定義頁面。但是,當手動導航到 index.html 時,它會正常載入 Twitter Archive GUI。

我的問題是,我可以使用 warcit 的哪些參數來定義 index.html 為頁面?

我使用的命令是:

warcit --name twitter_archive -o --no-gzip -d 20221122010159 --index-files=index.html http://website.com/ "E:/twitter_archive/"

答案1

看起來您正在使用 warcit 工具從本地 Twitter 存檔建立 WARC 檔案。 warcit 工具可讓您透過抓取網站並將頁面和相關資源(例如圖像和樣式表)儲存到 WARC 檔案來從網站建立 WARC 檔案。

若要建立將 Twitter 檔案中的 index.html 檔案作為頁麵包含的 WARC 文件,您可以使用 --index-files 選項和 index.html 檔案的路徑。例如:

warcit --name twitter_archive -o --no-gzip -d 20221122010159 --index-files=E:/twitter_archive/index.html http://website.com/ "E:/twitter_archive/"

這將創建一個 WARC 文件,其中包含作為頁面的 index.html 文件,以及從該文件連結的任何其他頁面和資源。

如果要將 Twitter 檔案中的所有檔案包含在 WARC 檔案中,可以使用 --mirror 選項而不是 --index-files 選項。這將創建一個 WARC 文件,其中包含 Twitter 存檔中的所有文件,而不僅僅是從特定索引文件連結的文件。

warcit --name twitter_archive -o --no-gzip -d 20221122010159 --mirror http://website.com/ "E:/twitter_archive/"

相關內容