Awesome
gh-readme-scrape
A small CLI which scrapes GitHub readme pages for links and images of a certain file type, and then bulk downloads them into a destination folder.
Install
npm install -g gh-readme-scrape
Examples
For example, to bulk download the SVGs from gilbarbara/logos:
gh-readme-scrape gilbarbara/logos logos/ -e svg
This will save all the SVGs into a local folder called logos
, see below:
Or, to bulk download PDFs from the graphics-resources readme:
gh-readme-scrape mattdesl/graphics-resources papers/ -e pdf --rename
The --rename
flag will use the anchor text in the markdown to determine the file name. Result:
Usage
Usage:
gh-readme-scrape repository output [opts]
Options:
--extension, -e a list of extensions, comma-separated
--rename, -r rename filenames to the Markdown anchor text
--timeout=n ms timeout before failing a request (default 4000ms)
--verbose log all requests
--auth authorize the readme request with GH API
The repository
can be a full URL to the repository, or a shorthand like gilbarbara/logos
.
The extensions can be comma-separated, such as:
gh-readme-scrape gilbarbara/logos tmp -e svg,png,gif
License
MIT, see LICENSE.md for details.