Created
May 2, 2021 15:15
-
-
Save jdmichaud/c0c6a301c75921e3d295ab67a30c8d91 to your computer and use it in GitHub Desktop.
Extract Wikipedia dumps
This file contains hidden or 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
| #!/bin/bash | |
| # First download the page listing all the dumps, then extract, with some brittle xpath magic the list of dump files and curl them locally. | |
| curl -sL https://dumps.wikimedia.org/commonswiki/20210420/ | \ | |
| xidel --xpath '//li[./span[contains(@class, "title") and ./big/b/text() = "Articles, templates, media/file descriptions, and primary meta-pages."]]/ul/li/a/@href' - | \ | |
| xargs -n 1 -i curl --progress-bar -OL -C - https://dumps.wikimedia.org/{} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment