Mercurial > ec-dotfiles
comparison bin/moefetch @ 371:38c7615caf9e
Reduced limit to 100.
| author | Edho Arief <edho@myconan.net> |
|---|---|
| date | Thu, 28 Jun 2012 09:09:37 +0700 |
| parents | fc644e52df7c |
| children |
comparison
equal
deleted
inserted
replaced
| 370:fc644e52df7c | 371:38c7615caf9e |
|---|---|
| 116 | 116 |
| 117 # generate link by transforming xml | 117 # generate link by transforming xml |
| 118 Generate_Link() { | 118 Generate_Link() { |
| 119 echo " | 119 echo " |
| 120 Fetching XML file" | 120 Fetching XML file" |
| 121 tempnum=1000 | 121 pagelimit=100 |
| 122 tempnum="${pagelimit}" | |
| 122 iternum=1 | 123 iternum=1 |
| 123 > "${TEMP_PREFIX}-list" | 124 > "${TEMP_PREFIX}-list" |
| 124 while [ "${tempnum}" -ge 1000 ]; do | 125 while [ "${tempnum}" -ge "${pagelimit}" ]; do |
| 125 url="${SITE}/post/index.xml?tags=$(get_cleantags "${TAGS}")&offset=0&limit=1000&page=${iternum}" | 126 url="${SITE}/post/index.xml?tags=$(get_cleantags "${TAGS}")&offset=0&limit=${pagelimit}&page=${iternum}" |
| 126 [ ${_use_login} -eq 1 ] && url="${url}&login=${LOGIN_USER}&password_hash=${LOGIN_PASS}" | 127 [ ${_use_login} -eq 1 ] && url="${url}&login=${LOGIN_USER}&password_hash=${LOGIN_PASS}" |
| 127 wget --no-check-certificate --quiet "${url}" -O "${TEMP_PREFIX}-xml" --referer="${SITE}/post" --user-agent="${useragent}" -e continue=off || Err_Fatal "Failed download catalog file" | 128 wget --no-check-certificate --quiet "${url}" -O "${TEMP_PREFIX}-xml" --referer="${SITE}/post" --user-agent="${useragent}" -e continue=off || Err_Fatal "Failed download catalog file" |
| 128 printf "Processing XML file... " | 129 printf "Processing XML file... " |
| 129 # xslt evilry | 130 # xslt evilry |
| 130 xsltproc - "${TEMP_PREFIX}-xml" <<EOF | sed 's/.*\(https*.*\)\(\/[a-f0-9]\{32\}\).*\.\([^\.]*\)/\1\2.\3/g' | grep ^http > "${TEMP_PREFIX}-templist" | 131 xsltproc - "${TEMP_PREFIX}-xml" <<EOF | sed 's/.*\(https*.*\)\(\/[a-f0-9]\{32\}\).*\.\([^\.]*\)/\1\2.\3/g' | grep ^http > "${TEMP_PREFIX}-templist" |
