summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatolaZ <katolaz@freaknet.org>2020-01-09 08:08:55 +0000
committerKatolaZ <katolaz@freaknet.org>2020-01-09 08:08:55 +0000
commitc9dd2610b1d27ed632fdf912e1ba1e093ec373e0 (patch)
treead13d7b5abfbf230c8e495005581da4ef3226440
parentddb926830977e7a4a5fe5b91820bdce34c8826e7 (diff)
add author and descr in stagit repos
-rwxr-xr-xparse_stagit9
1 files changed, 6 insertions, 3 deletions
diff --git a/parse_stagit b/parse_stagit
index be52ee3..6830e12 100755
--- a/parse_stagit
+++ b/parse_stagit
@@ -14,6 +14,8 @@ URLBASE="$1"
DEST="$2"
SUBPATH="/file"
CURL="torify curl -Ls "
+READMES="README.html README.txt.html README.md.html readme.html readme.txt.html readme.md.html"
+TMPFILE="./tmp_$$"
## func
@@ -34,7 +36,9 @@ repos=$(cat $TMPFILE | grep "/html/body/div/table/tbody/tr/td/a" \
## func
get_descr() {
reponame=$1
+ url=$2
echo "reponame: $reponame"
+ echo "url: $url"
## Get author and description
cat "$TMPFILE" | grep -Ei -A 2 "/html/body/div/table/tbody/tr/td/a[[:blank:]]+href=${reponame}/log.html" |\
tail -2 | cut -f 2-
@@ -72,8 +76,6 @@ DIRBASE="$PROTO/${URLBASE##[a-z]*:\/\/}"
echo "proto: $PROTO"
echo "dirbase: $DIRBASE"
-READMES="README.html README.txt.html README.md.html readme.html readme.txt.html readme.md.html"
-TMPFILE="./tmp_$$"
trap cleanup EXIT KILL TERM INT
@@ -89,7 +91,8 @@ for r in $repos; do
printf "link: %s\nbaselink: %s\n" $link $baselink 1>&2
REPODIR="$DEST/$DIRBASE/$link/"
mkdir -p $REPODIR
- get_descr $name > ${REPODIR}/DESCR
+ ## get description
+ get_descr "$name" "$baselink" > ${REPODIR}/DESCR
## Get READMEs
get_readmes "$baselink/$SUBPATH" "$REPODIR"
done