Created
November 12, 2010 22:40
-
-
Save eduo/674830 to your computer and use it in GitHub Desktop.
Obtener todas las imágenes de una revista de youkioske
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
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