Skip to content

Instantly share code, notes, and snippets.

@eduo
Created November 12, 2010 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eduo/674830 to your computer and use it in GitHub Desktop.
Save eduo/674830 to your computer and use it in GitHub Desktop.
Obtener todas las imágenes de una revista de youkioske
KIOSKEMAG="http://youkioske.com/revistas-masculinas/gq-magazine-november-2010-3/"
curl -o tempfile -s "${KIOSKEMAG}"
TITLE=$(cat tempfile | grep "href="'"" ' | head -n1 | cut -f2 -d\> | cut -f1 -d\< )
echo "Title is: ${TITLE}"
ISSUUBASE="http://image.issuu.com/"\
$(curl -s \
$(curl -s \
$(cat tempfile |\
grep srcIframe | grep var | sed -e's|^.*\(http.*\)".*|\1|g') |\
grep http | sed -e's|.*\(http:.*\)\?mode=embed.*|\1|g') |\
grep -i \"documentid|grep -v ',' | \
cut -f2 -d: | \
tr -d " "| \
tr -d '"')"/jpg/"
PAGE=1
type="NON"
until [ ${type} = 'XML' ]
do
FILE='page_'${PAGE}'.jpg'
echo "Downloading page: ${PAGE}"
curl -s "${ISSUUBASE}""${FILE}">"${FILE}"
type=$(file ${FILE}|cut -f2 -d" ")
echo "Type is ${type}"
let PAGE=PAGE+1
done
rm ${FILE}
mkdir "${TITLE}"
mv *.jpg "${TITLE}"
zip -r "${TITLE}".cbz "${TITLE}"
rm tempfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment