# HG changeset patch # User edhoprima@gmail.com # Date 1246353782 0 # Node ID dd95cf01602cd60825a110813cd49ac977dfcbee # Parent da4c03c7377c7542762655b4de2246d2a5bd64df working around limit diff -r da4c03c7377c -r dd95cf01602c moefetch.sh --- a/moefetch.sh Mon Jun 29 17:35:43 2009 +0000 +++ b/moefetch.sh Tue Jun 30 09:23:02 2009 +0000 @@ -84,11 +84,15 @@ # generate link by transforming xml Generate_Link() { printf "\nFetching xml file\n" - wget "http://${SITE}/post/index.xml?tags=${TAGS}&offset=0&limit=100000" -O "${TEMP_PREFIX}-xml" -e continue=off - printf "Processing XML file..." - # xslt evilry + TEMPNUM=1001 + _i=1 > "${TEMP_PREFIX}-list" - xsltproc - "${TEMP_PREFIX}-xml" < "${TEMP_PREFIX}-list" 2>/dev/null + while [ "${TEMPNUM}" -ge 1000 ]; do + wget "http://${SITE}/post/index.xml?tags=${TAGS}&offset=0&limit=1000&page=${_i}" -O "${TEMP_PREFIX}-xml" -e continue=off + printf "Processing XML file..." + # xslt evilry + > "${TEMP_PREFIX}-templist" + xsltproc - "${TEMP_PREFIX}-xml" < "${TEMP_PREFIX}-templist" 2>/dev/null @@ -96,6 +100,10 @@ EOF + TEMPNUM=$(echo $(wc -l < "${TEMP_PREFIX}-templist")) + _i=$((_i+1)) + cat "${TEMP_PREFIX}-templist" >> "${TEMP_PREFIX}-list" + done NUMFILES=$(echo $(wc -l < "${TEMP_PREFIX}-list")) [ "${NUMFILES}" -gt 0 ] || Err_Fatal "Error in processing list or no files can be found with specified tag(s) or site" echo " ${NUMFILES} file(s) available on server"