Created
July 23, 2013 09:20
-
-
Save mebius01/6061111 to your computer and use it in GitHub Desktop.
Граббер для сайта http://2photo.ru/
Переосмысленный https://gist.github.com/mebius01/5030198
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
#!/bin/bash | |
#23.07.13 | |
#Для сайта http://2photo.ru/ | |
#Создает директорию с именем поста | |
#скачивает в эту директорию картинки | |
http="http:" | |
echo "Введите адрес ссылки:" | |
read URL && | |
wget $URL && | |
CATID=`echo "$URL" | cut -d'/' -f6` && | |
MKDIR=`cat "$CATID" | sed -n '/<h1>/p' | cut -d'>' -f2 | cut -d'<' -f1` && | |
mkdir "$MKDIR" && | |
ECHO=`echo "$MKDIR"` && | |
CAT=`cat "$CATID" | sed -n '/;" href="/p' | sed 's/><img /\n/g' | sed '/>/d' | cut -d'"' -f4` && | |
echo "$CAT" | |
(cd "$MKDIR" && | |
for i in $CAT | |
do | |
wget $http$i | |
done | |
) | |
rm "$CATID" | |
echo "ok" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment