Last active
March 21, 2018 06:40
-
-
Save nanpuyue/625473fb186ca13da5e7aa94c7a8efd4 to your computer and use it in GitHub Desktop.
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 | |
| # file: dl_qt_example.sh | |
| # date: 2018-03-21 | |
| # license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt | |
| # author: nanpuyue <[email protected]> https://blog.nanpuyue.com | |
| URL="http://doc.qt.io/qt-5/qtwidgets-itemviews-frozencolumn-example.html" | |
| BASE_URL=${URL%/*} | |
| curl -so- "$URL"|\ | |
| sed -n '/^<p>Files\:/,/@@@/p'|\ | |
| grep -Po '(?<=href\=").*?(?=")'|\ | |
| while read line;do | |
| data="$(curl -so- "$BASE_URL/$line")" | |
| file="$(echo "$data"|grep -Po '(?<=@@@).*?(?=\s)')" | |
| mkdir -p "${file%/*}" || true | |
| echo "$data"|\ | |
| sed -n '/\$\$\$/,/@@@/p'|\ | |
| w3m -dump -T text/html|\ | |
| grep -v '^\['|\ | |
| cat > "$file" | |
| echo "file: $file downloaded." | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment