### Install pywb from Local Copy Source: https://github.com/webrecorder/pywb Installs pywb from a locally cloned repository using either an editable install or the setup script. ```shell pip install -e . # or python setup.py install ``` -------------------------------- ### Install pywb from Local Copy Source: https://github.com/webrecorder/pywb Installs pywb from a cloned local repository using an editable install or setup.py. This is useful for development. ```Python pip install -e . python setup.py install ``` -------------------------------- ### Basic Embedding Example Source: https://replayweb.page/docs/embedding/ Demonstrates the basic setup for embedding a ReplayWeb.page archive, including the necessary script tag and the custom replay-web-page element. It shows how to specify the source WACZ file and the starting URL. ```html ``` -------------------------------- ### Configuration Example Source: https://github.com/webrecorder/browsertrix-crawler An example of a server configuration setting, likely used within the Browsertrix Crawler environment or a related system. ```json { "resolvedServerColorMode": "day" } ``` -------------------------------- ### Install CDXJ Indexer Source: https://github.com/webrecorder/cdxj-indexer Installs the CDXJ Indexer tool using pip or directly from source. This is the primary method for setting up the command-line utility. ```shell pip install cdxj-indexer ``` ```shell python setup.py install ``` -------------------------------- ### Install and Run Tests Source: https://github.com/webrecorder/pywb Installs necessary tools (tox, tox-current-env) for running tests in the current Python environment. ```shell pip install tox tox-current-env tox --current-env ``` -------------------------------- ### Example: Convert a downloaded website to WARC Source: https://github.com/webrecorder/warcit This example demonstrates downloading a website using `wget` and then converting the downloaded files into a WARC archive using `warcit`. The output WARC file is named `www.iana.org.warc.gz`. ```shell wget -l 1 -r www.iana.org/ warcit http://www.iana.org/ ./www.iana.org/ ``` -------------------------------- ### Install har2warc Source: https://github.com/webrecorder/har2warc Installs the har2warc package using pip. This is the primary method to get the tool and library for use. ```bash pip install har2warc ``` -------------------------------- ### Install warcit using pip Source: https://github.com/webrecorder/warcit Installs the warcit command-line tool as a Python package using pip. This is the recommended method for obtaining the utility. ```Shell pip install warcit ``` -------------------------------- ### Install pywb via pip Source: https://github.com/webrecorder/pywb Installs the pywb package using pip. Depending on the Python installation, pip3 might be required instead of pip. ```shell pip install pywb ``` -------------------------------- ### Install pywb using pip Source: https://github.com/webrecorder/pywb Installs the pywb library using pip. Depending on your Python installation, you might need to use pip3 instead of pip. ```Python pip install pywb ``` -------------------------------- ### Install and Run pywb Tests Source: https://github.com/webrecorder/pywb Installs tox and tox-current-env for running tests within your current Python environment. Execute 'tox --current-env' to run the tests. ```Python pip install tox tox-current-env tox --current-env ``` -------------------------------- ### Install warcit using pip Source: https://github.com/webrecorder/warcit Install the warcit command-line utility as a Python package using pip. This makes the `warcit` command available in your system's PATH. ```shell pip install warcit ``` -------------------------------- ### Run pywb Application Source: https://github.com/webrecorder/pywb Executes the pywb application after installation. Consult the local or online documentation for the latest usage and configuration details. ```Shell pywb wayback ``` -------------------------------- ### Example WARC Record Structure Source: https://github.com/webrecorder/warcit Illustrates the structure of a WARC record generated by warcit, showcasing standard WARC headers and custom extension headers like WARC-Creation-Date and WARC-Source-URI, which store the actual WARC creation time and the path to the source file. ```text WARC/1.0 WARC-Date: 2011-02-01T00:00:00Z WARC-Creation-Date: 2017-12-05T18:30:58Z WARC-Source-URI: file://./path/to/somefile.html WARC-Type: resource WARC-Record-ID: ... WARC-Target-URI: http://www.example.com/to/somefile.html Content-Type: text/html Content-Length ... ... ``` -------------------------------- ### Run pywb Application Source: https://github.com/webrecorder/pywb Executes the pywb application or its alias 'wayback' after installation. ```shell pywb # or wayback ``` -------------------------------- ### WARCinfo Record Example Source: https://github.com/webrecorder/warcit Illustrates the structure of a WARCinfo record, which is automatically added to the beginning of a WARC file by warcit unless the --no-warcinfo flag is used. It includes metadata about the conversion process. ```APIDOC WARC/1.0 WARC-Type: warcinfo WARC-Record-ID: ... WARC-Filename: example.com.warc.gz WARC-Date: 2017-12-05T18:30:58Z Content-Type: application/warc-fields Content-Length: ... software: warcit 0.2.0 format: WARC File Format 1.0 cmdline: warcit --fixed-dt 2011-02 http://example.com/ ./path/to/somefile.html ``` -------------------------------- ### ReplayWeb.page Configuration Source: https://replayweb.page/docs/embedding/ Example JSON configuration object for ReplayWeb.page, specifying features, search worker paths, and translation strings. ```json { "base": "../..", "features": [ "navigation.sections", "navigation.tabs", "navigation.tabs.sticky", "navigation.instant", "navigation.tracking", "navigation.indexes", "navigation.footer", "content.code.copy", "content.action.edit", "content.tooltips", "search.suggest" ], "search": "../../assets/javascripts/workers/search.d50fe291.min.js", "tags": null, "translations": { "clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version" }, "version": null } ``` -------------------------------- ### Install and Use har2warc CLI Source: https://github.com/webrecorder/har2warc Installs the har2warc library using pip and demonstrates its command-line usage for converting a HAR file to a WARC file. The CLI takes an input HAR file path and an output WARC file path. ```bash pip install har2warc har2warc ``` -------------------------------- ### WARC Resource Record Example Source: https://github.com/webrecorder/warcit Shows a typical WARC resource record generated by warcit for a file. It includes standard WARC headers and extension headers like WARC-Creation-Date and WARC-Source-URI, demonstrating how file metadata is preserved. ```APIDOC WARC/1.0 WARC-Date: 2011-02-01T00:00:00Z WARC-Creation-Date: 2017-12-05T18:30:58Z WARC-Source-URI: file://./path/to/somefile.html WARC-Type: resource WARC-Record-ID: ... WARC-Target-URI: http://www.example.com/to/somefile.html Content-Type: text/html Content-Length ... ``` -------------------------------- ### Clone pywb Repository Source: https://github.com/webrecorder/pywb Clones the pywb project from its GitHub repository to your local machine for development or local installation. ```Git git clone https://github.com/webrecorder/pywb ``` -------------------------------- ### Custom User Agent Example Source: https://docs.browsertrix.com/user-guide/workflow-setup/ Sets the browser's user agent string for outgoing requests. This can be used to bypass website restrictions or identify crawling activity. The example shows a common format including browser details and an optional organizational identifier. ```text Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.3 orgname.browsertrix (+https://example.com/crawling-explination-page) ``` -------------------------------- ### Manage ReplayWeb.page Versions via CDN Source: https://replayweb.page/docs/embedding/ Provides examples of loading ReplayWeb.page UI and service worker scripts from a CDN, illustrating how to pin to specific versions for stability or use the latest release. Using fixed versions is recommended for production to prevent unexpected breaks. ```javascript # Load a specific version (recommended for production) https://cdn.jsdelivr.net/npm/replaywebpage@2.3.16/ui.js https://cdn.jsdelivr.net/npm/replaywebpage@2.3.16/sw.js ``` ```javascript # Load the latest stable release (not recommended for production) https://cdn.jsdelivr.net/npm/replaywebpage/ui.js https://cdn.jsdelivr.net/npm/replaywebpage/sw.js ``` ```javascript # Load the very latest (for testing, most likely to break) https://replay.web.page/ui.js https://replay.web.page/sw.js ``` -------------------------------- ### Download Website with warcit and wget Source: https://github.com/webrecorder/warcit This snippet demonstrates how to use `wget` and `warcit` to download a website and create a WARC file. It shows the command to initiate the download and the expected output file. ```shell wget -l 1 -r www.iana.org/\ warcit http://www.iana.org/ ./www.iana.org/ ``` -------------------------------- ### Build Documentation Locally Source: https://github.com/webrecorder/pywb Navigates to the docs directory and builds the HTML documentation using make. ```shell cd docs make html ``` -------------------------------- ### Build pywb Documentation Locally Source: https://github.com/webrecorder/pywb Navigates to the docs directory and builds the HTML documentation using make. The output will be located at './_build/html/index.html'. ```Shell cd docs make html ``` -------------------------------- ### Basic warcit command usage Source: https://github.com/webrecorder/warcit Demonstrates the fundamental syntax for using the warcit command-line tool to create WARC files from specified directories or files. Use 'warcit -h' for a complete list of options. ```Shell warcit ... ``` -------------------------------- ### Project Configuration and Scripts Source: https://github.com/webrecorder/pywb This entry lists common configuration files and shell scripts used within the pywb project. These files manage dependencies, testing, deployment, and build processes. ```shell # docker-entrypoint.sh # Script for Docker container entrypoint. ``` ```text # extra_requirements.txt # Lists extra Python dependencies. ``` ```text # requirements.txt # Lists core Python dependencies. ``` ```shell # run-gunicorn.sh # Script to run the application using Gunicorn. ``` ```python # run-tests.py # Python script for executing tests. ``` ```shell # run-uwsgi.sh # Script to run the application using uWSGI. ``` ```python # setup.py # Python script for package installation and setup. ``` ```text # test_requirements.txt # Lists Python dependencies for testing. ``` ```ini # tox.ini # Configuration file for tox, a Python testing tool. ``` ```shell # update-tag.sh # Script for updating version tags. ``` ```ini # uwsgi.ini # Configuration file for the uWSGI server. ``` -------------------------------- ### Run Basic Crawl with Docker Source: https://crawler.docs.browsertrix.com/user-guide/ This snippet demonstrates the essential steps to run a basic crawl using Browsertrix Crawler via Docker. It covers pulling the image, running a crawl for a specified URL, and generating a WACZ file. Dependencies include Docker and a target URL. ```bash docker pull webrecorder/browsertrix-crawler docker run -v $PWD/crawls:/crawls/ -it webrecorder/browsertrix-crawler crawl --url [URL] --generateWACZ --text --collection test ``` -------------------------------- ### Handle Target Element Selection by Hash Source: https://crawler.docs.browsertrix.com/user-guide/ This JavaScript snippet selects an HTML element based on the current URL's hash. It then checks if the element has a 'name' attribute and if that name starts with '__tabbed_' to potentially control its checked state. ```javascript var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_")) ``` -------------------------------- ### Webrecorder Project Configuration Source: https://docs.browsertrix.com/user-guide/workflow-setup/ This JSON object represents a configuration for a Webrecorder project, specifying base paths, enabled features like sticky navigation and code copying, search worker paths, and localization strings for UI elements such as clipboard actions and search results. ```json { "base": "../..", "features": [ "navigation.tabs", "navigation.tabs.sticky", "navigation.instant", "navigation.tracking", "navigation.footer", "content.code.copy", "content.action.edit", "content.tooltips", "search.suggest" ], "search": "../../assets/javascripts/workers/search.d50fe291.min.js", "tags": null, "translations": { "clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version" }, "version": null } ``` -------------------------------- ### Configure Mime Type Overrides in warcit Source: https://github.com/webrecorder/warcit This example shows how to use the `--mime-overrides` flag with `warcit` to specify custom mime types for specific file patterns. It allows overriding default detection for files like *.html and *.ico. ```shell warcit '--mime-overrides=*.html=text/html; charset="utf-8",image.ico=image/png' http://www.iana.org/ ./www.iana.org/ ``` -------------------------------- ### Webrecorder pywb Project Overview Source: https://github.com/webrecorder/pywb This snippet provides an overview of the pywb project, including its version, purpose, and development status indicators. It's presented in Markdown format. ```markdown # Webrecorder pywb 2.9 ![CI Badge](https://github.com/webrecorder/pywb/workflows/CI/badge.svg) ![Codecov Badge](https://codecov.io/gh/webrecorder/pywb/branch/main/graph/badge.svg) Web Archiving Tools for All ``` -------------------------------- ### CSS Variables for Admonition Icons Source: https://crawler.docs.browsertrix.com/user-guide/ Defines CSS variables that map to SVG icons used for different types of admonitions (failure, danger, bug, example, quote). These are typically used within a documentation framework to style informational messages. ```css :root { --md-admonition-icon--failure:url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22currentColor%22%20class%3D%22bi%20bi-x-octagon-fill%22%20viewBox%3D%220%200%2016%2016%22%3E%20%20%3Cpath%20d%3D%22M11.46.146A.5.5%200%200%200%2011.107%200H4.893a.5.5%200%200%200-.353.146L.146%204.54A.5.5%200%200%200%200%204.893v6.214a.5.5%200%200%200%20.146.353l4.394%204.394a.5.5%200%200%200%20.353.146h6.214a.5.5%200%200%200%20.353-.146l4.394-4.394a.5.5%200%200%200%20.146-.353V4.893a.5.5%200%200%200-.146-.353L11.46.146zm-6.106%204.5L8%207.293l2.646-2.647a.5.5%200%200%201%20.708.708L8.707%208l2.647%202.646a.5.5%200%200%201-.708.708L8%208.707l-2.646%202.647a.5.5%200%200%201-.708-.708L7.293%208%204.646%205.354a.5.5%200%201%201%20.708-.708z%22/%3E%3C/svg%3E');--md-admonition-icon--danger:url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22currentColor%22%20class%3D%22bi%20bi-exclamation-diamond-fill%22%20viewBox%3D%220%200%2016%2016%22%3E%20%20%3Cpath%20d%3D%22M9.05.435c-.58-.58-1.52-.58-2.1%200L.436%206.95c-.58.58-.58%201.519%200%202.098l6.516%206.516c.58.58%201.519.58%202.098%200l6.516-6.516c.58-.58.58-1.519%200-2.098L9.05.435zM8%204c.535%200%20.954.462.9.995l-.35%203.507a.552.552%200%200%201-1.1%200L7.1%204.995A.905.905%200%200%201%208%204zm.002%206a1%201%200%201%201%200%202%201%201%200%200%201%200-2z%22/%3E%3C/svg%3E');--md-admonition-icon--bug:url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22currentColor%22%20class%3D%22bi%20bi-bug-fill%22%20viewBox%3D%220%200%2016%2016%22%3E%20%20%3Cpath%20d%3D%22M4.978.855a.5.5%200%201%200-.956.29l.41%201.352A4.985%204.985%200%200%200%203%206h10a4.985%204.985%200%200%200-1.432-3.503l.41-1.352a.5.5%200%201%200-.956-.29l-.291.956A4.978%204.978%200%200%200%208%201a4.979%204.979%200%200%200-2.731.811l-.29-.956z%22/%3E%20%20%3Cpath%20d%3D%22M13%206v1H8.5v8.975A5%205%200%200%200%2013%2011h.5a.5.5%200%200%201%20.5.5v.5a.5.5%200%201%200%201%200v-.5a1.5%201.5%200%200%200-1.5-1.5H13V9h1.5a.5.5%200%200%200%200-1H13V7h.5A1.5%201.5%200%200%200%2015%205.5V5a.5.5%200%200%200-1%200v.5a.5.5%200%200%201-.5.5H13zm-5.5%209.975V7H3V6h-.5a.5.5%200%200%201-.5-.5V5a.5.5%200%200%200-1%200v.5A1.5%201.5%200%200%200%202.5%207H3v1H1.5a.5.5%200%200%200%200%201H3v1h-.5A1.5%201.5%200%200%200%201%2011.5v.5a.5.5%200%201%200%201%200v-.5a.5.5%200%200%201%20.5-.5H3a5%205%200%200%200%204.5%204.975z%22/%3E%3C/svg%3E');--md-admonition-icon--example:url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22currentColor%22%20class%3D%22bi%20bi-mortarboard-fill%22%20viewBox%3D%220%200%2016%2016%22%3E%20%20%3Cpath%20d%3D%22M8.211%202.047a.5.5%200%200%200-.422%200l-7.5%203.5a.5.5%200%200%200%20.025.917l7.5%203a.5.5%200%200%200%20.372%200L14%207.14V13a1%201%200%200%200-1%201v2h3v-2a1%201%200%200%200-1-1V6.739l.686-.275a.5.5%200%200%200%20.025-.917l-7.5-3.5Z%22/%3E%20%20%3Cpath%20d%3D%22M4.176%209.032a.5.5%200%200%200-.656.327l-.5%201.7a.5.5%200%200%200%20.294.605l4.5%201.8a.5.5%200%200%200%20.372%200l4.5-1.8a.5.5%200%200%200%20.294-.605l-.5-1.7a.5.5%200%200%200-.656-.327L8%2010.466%204.176%209.032Z%22/%3E%3C/svg%3E');--md-admonition-icon--quote:url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22currentColor%22%20class%3D%22bi%20bi-quote%22%20viewBox%3D%220%200%2016%2016%22%3E%20%20%3Cpath%20d%3D%22M12%2012a1%201%200%200%200%201-1V8.558a1%201%200%200%200-1-1h-1.388c0-.351.021-.703.062-1.054.062-.372.166-.703.31-.992.145-.29.331-.517.559-.683.227-.186.516-.279.868-.279V3c-.579%200-1.085.124-1.52.372a3.322%203.322%200%200%200-1.085.992%204.92%204.92%200%200%200-.62%201.458A7.712%207.712%200%200%200%209%207.558V11a1%201%200%200%200%201%201h2Zm-6%200a1%201%200%200%200%201-1V8.558a1%201%200%200%200-1-1H4.612c0-.351.021-.703.062-1.054.062-.372.166-.703.31-.992.145-.29.331-.517.559-.683.227-.186.516-.279.868-.279V3c-.579%200-1.085.124-1.52.372a3.322%203.322%200%200%200-1.085.992%204.92%204.92%200%200%200-.62%201.458A7.712%207.712%200%200%200%203%207.558V11a1%201%200%200%200%201%201h2Z%22/%3E%3C/svg%3E'); --md-text-font:"Roboto"; --md-code-font:"Roboto Mono" } ``` -------------------------------- ### CSS Styling Variables and Icons Source: https://docs.browsertrix.com/user-guide/workflow-setup/ Defines CSS custom properties for font families and includes SVG icons embedded as data URIs for various admonition types (danger, bug, example, quote). These are used for visual styling and thematic elements within the documentation. ```css :root { --md-text-font: "Roboto"; --md-code-font: "Roboto Mono"; } --md-admonition-icon--danger: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22currentColor%22%20class%3D%22bi%20bi-exclamation-diamond-fill%22%20viewBox%3D%220%200%2016%2016%22%3E%20%20%3Cpath%20d%3D%22M9.05.435c-.58-.58-1.52-.58-2.1%200L.436%206.95c-.58.58-.58%201.519%200%202.098l6.516%206.516c.58.58%201.519.58%202.098%200l6.516-6.516c.58-.58.58-1.519%200-2.098zM8%204c.535%200%20.954.462.9.995l-.35%203.507a.552.552%200%200%201-1.1%200L7.1%204.995A.905.905%200%200%201%208%204m.002%206a1%201%200%201%201%200%202%201%201%200%200%201%200-2%22/%3E%3C/svg%3E'); --md-admonition-icon--bug: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22currentColor%22%20class%3D%22bi%20bi-bug-fill%22%20viewBox%3D%220%200%2016%2016%22%3E%20%20%3Cpath%20d%3D%22M4.978.855a.5.5%200%201%200-.956.29l.41%201.352A4.985%204.985%200%200%200%203%206h10a4.985%204.985%200%200%200-1.432-3.503l.41-1.352a.5.5%200%201%200-.956-.29l-.291.956A4.978%204.978%200%200%200%208%201a4.979%204.979%200%200%200-2.731.811l-.29-.956z%22/%3E%20%20%3Cpath%20d%3D%22M13%206v1H8.5v8.975A5%205%200%200%200%2013%2011h.5a.5.5%200%200%201%20.5.5v.5a.5.5%200%201%200%201%200v-.5a1.5%201.5%200%200%200-1.5-1.5H13V9h1.5a.5.5%200%200%200%200-1H13V7h.5A1.5%201.5%200%200%200%2015%205.5V5a.5.5%200%200%200-1%200v.5a.5.5%200%200%201-.5.5H13zm-5.5%209.975V7H3V6h-.5a.5.5%200%200%201-.5-.5V5a.5.5%200%200%200-1%200v.5A1.5%201.5%200%200%200%202.5%207H3v1H1.5a.5.5%200%200%200%200%201H3v1h-.5A1.5%201.5%200%200%200%201%2011.5v.5a.5.5%200%201%200%201%200v-.5a.5.5%200%200%201%20.5-.5H3a5%205%200%200%200%204.5%204.975z%22/%3E%3C/svg%3E'); --md-admonition-icon--example: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22currentColor%22%20class%3D%22bi%20bi-mortarboard-fill%22%20viewBox%3D%220%200%2016%2016%22%3E%20%20%3Cpath%20d%3D%22M8.211%202.047a.5.5%200%200%200-.422%200l-7.5%203.5a.5.5%200%200%200%20.025.917l7.5%203a.5.5%200%200%200%20.372%200L14%207.14V13a1%201%200%200%200-1%201v2h3v-2a1%201%200%200%200-1-1V6.739l.686-.275a.5.5%200%200%200%20.025-.917l-7.5-3.5Z%22/%3E%20%20%3Cpath%20d%3D%22M4.176%209.032a.5.5%200%200%200-.656.327l-.5%201.7a.5.5%200%200%200%20.294.605l4.5%201.8a.5.5%200%200%200%20.372%200l4.5-1.8a.5.5%200%200%200%20.294-.605l-.5-1.7a.5.5%200%200%200-.656-.327L8%2010.466%204.176%209.032Z%22/%3E%3C/svg%3E'); --md-admonition-icon--quote: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22currentColor%22%20class%3D%22bi%20bi-quote%22%20viewBox%3D%220%200%2016%2016%22%3E%20%20%3Cpath%20d%3D%22M12%2012a1%201%200%200%200%201-1V8.558a1%201%200%200%200-1-1h-1.388c0-.351.021-.703.062-1.054.062-.372.166-.703.31-.992.145-.29.331-.517.559-.683.227-.186.516-.279.868-.279V3c-.579%200-1.085.124-1.52.372a3.322%203.322%200%200%200-1.085.992%204.92%204.92%200%200%200-.62%201.458A7.712%207.712%200%200%200%209%207.558V11a1%201%200%200%200%201%201h2Zm-6%200a1%201%200%200%200%201-1V8.558a1%201%200%200%200-1-1H4.612c0-.351.021-.703.062-1.054.062-.372.166-.703.31-.992.145-.29.331-.517.559-.683.227-.186.516-.279.868-.279V3c-.579%200-1.085.124-1.52.372a3.322%203.322%200%200%200-1.085.992%204.92%204.92%200%200%200-.62%201.458A7.712%207.712%200%200%200%203%207.558V11a1%201%200%200%200%201%201h2Z%22/%3E%3C/svg%3E'); ``` -------------------------------- ### Documentation Link Object Source: https://github.com/webrecorder/cdxj-indexer This JSON object contains properties, including a URL pointing to documentation for keyboard shortcuts on GitHub. ```JSON {"props":{"docsUrl":"https://docs.github.com/get-started/accessibility/keyboard-shortcuts"}} ``` -------------------------------- ### JavaScript for Tab Selection Source: https://docs.browsertrix.com/user-guide/workflow-setup/ This JavaScript code snippet targets an HTML element based on the URL's hash fragment. It then checks if the element's name starts with '__tabbed_' and, if so, sets the element's 'checked' property accordingly, likely for managing tabbed interfaces. ```javascript var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_")) ``` -------------------------------- ### Convert Specific ZIP File Paths to WARCs Source: https://github.com/webrecorder/warcit Process ZIP archives by converting specified paths within them to WARC records. This allows selective archiving of content from within a ZIP file, ignoring other entries. The example shows converting two specific directories from a ZIP file. ```shell warcit --name my-warc.gz http:// my_zip_file.zip/www.example.com/ my_zip_file.zip/another.example.com/ ``` -------------------------------- ### Documentation Utility Functions (JavaScript) Source: https://docs.browsertrix.com/user-guide/workflow-setup/ Provides core JavaScript utility functions for managing documentation scope, hashing content, and persisting data using local storage. These functions are essential for the dynamic behavior and data handling within the documentation site. ```javascript var __md_scope = new URL("../..", location); var __md_hash = e => [...e].reduce(((e, _)=> (e << 5) - e + _.charCodeAt(0)), 0); var __md_get = (e, _ = localStorage, t = __md_scope) => JSON.parse(_.getItem(t.pathname + "." + e)); var __md_set = (e, _, t = localStorage, a = __md_scope) => { try { t.setItem(a.pathname + "." + e, JSON.stringify(_)); } catch (e) {} }; ``` -------------------------------- ### Schema.org BlogPosting Metadata Source: https://archiveweb.page/guide This JSON-LD snippet provides structured data for a blog post, detailing its context, type, modification and publication dates, description, headline, main entity page, publisher information, and URL. This helps search engines understand the content. ```json {"@context":"https://schema.org","@type":"BlogPosting","dateModified":"2024-12-09T08:01:36+00:00","datePublished":"2024-12-09T08:01:36+00:00","description":"User Guide for archiveweb.page","headline":"Guide to Archiveweb.page","mainEntityOfPage":{"@type":"WebPage","@id":"https://archiveweb.page/guide"},"publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://archiveweb.page/assets/brand/archivewebpage-icon-color.svg"}},"url":"https://archiveweb.page/guide"} ``` -------------------------------- ### CSS Styling for Site Navigation Source: https://archiveweb.page/guide This snippet contains CSS rules applied to the site navigation elements, specifically targeting link backgrounds, font weights, text decoration, and SVG transformations for menu expansion. It also controls the display of nested navigation lists. ```css .site-nav > ul:nth-of-type(1) > li:not(:nth-child(1)) > a, .site-nav > ul:nth-of-type(1) > li > ul > li a { background-image: none; } .site-nav > ul:not(:nth-of-type(1)) a, .site-nav li.external a { background-image: none; } .site-nav > ul:nth-of-type(1) > li:nth-child(1) > a { font-weight: 600; text-decoration: none; } .site-nav > ul:nth-of-type(1) > li:nth-child(1) > button svg, .site-nav > ul.nav-category-list > li > button svg { transform: rotate(-90deg); } .site-nav > ul:nth-of-type(1) > li.nav-list-item:nth-child(1) > ul.nav-list, .site-nav > ul.nav-category-list > li.nav-list-item > ul.nav-list { display: block; } ``` -------------------------------- ### JavaScript: Manipulate Element Checked State Source: https://docs.browsertrix.com/user-guide/browser-profiles/ This JavaScript snippet targets an HTML element based on the URL hash. It checks if the element exists and has a 'name' attribute, then updates its 'checked' property based on whether the 'name' attribute starts with '__tabbed_'. This is likely used for dynamic UI updates or state management within a web application. ```javascript var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_")) ``` -------------------------------- ### Clone pywb Repository Source: https://github.com/webrecorder/pywb Clones the pywb project repository from GitHub to a local directory. ```shell git clone https://github.com/webrecorder/pywb ``` -------------------------------- ### CDXJ Indexing with Custom Headers Source: https://github.com/webrecorder/cdxj-indexer Shows how to add custom HTTP headers (like Date, Referer) and request headers (like method) to the CDXJ index. The 'http:' prefix refers to response headers, and 'req.http:' refers to request headers. ```shell cdxj-indexer -f req.http:method,http:date,req.http:referer /path/to/archive-file.warc.gz com,example)/ 20170801032435 {"url": "http://example.com/", "mime": "text/html", "status": "200", "digest": "A6DESOVDZ3WLYF57CS5E4RIC4ARPWRK7", "length": "1207", "offset": "834", "filename": "temp-20170801032445.warc.gz", "req.http:method": "GET", "http:date": "Tue, 01 Aug 2017 03:24:35 GMT", "referrer": "https://webrecorder.io/temp-NU34HBNO/temp/recording-session/record/http://example.com/"} org,iana)/domains/example 20170801032437 {"url": "http://www.iana.org/domains/example", "mime": "text/html", "status": "302", "digest": "RP3Y66FDBYBZKSFYQ4VJ4RMDA5BPDJX2", "length": "675", "offset": "2652", "filename": "temp-20170801032445.warc.gz", "req.http:method": "GET", "http:date": "Tue, 01 Aug 2017 02:35:05 GMT", "referrer": "http://example.com/"} ```