Created
July 23, 2021 17:54
-
-
Save keizie/59e43e5e2339a6a1f12a158b948e2cd3 to your computer and use it in GitHub Desktop.
grab_munpia.sh (euc-kr) 2011-03-26
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/sh | |
TARGET_URL="$1" | |
BASE_URL=$(dirname $TARGET_URL) | |
NEXT_URL="go first" | |
until [ -z "$NEXT_URL" ] | |
do | |
w3m -I cp949 -O cp949 -cols 72 -dump $TARGET_URL | awk 'BEGIN {sw=""} /\[목록보기\]/ {sw=""} {if (sw) print} /댓글 부분으로/ {sw="ok"}' | |
NEXT_URL=$(w3m -dump_source $TARGET_URL | grep -m 1 "윗글" | awk -F\' '{print $2}') | |
TARGET_URL="$BASE_URL/$NEXT_URL" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment