Skip to content

Instantly share code, notes, and snippets.

@mebius01
Created July 23, 2013 09:20
Show Gist options
  • Save mebius01/6061111 to your computer and use it in GitHub Desktop.
Save mebius01/6061111 to your computer and use it in GitHub Desktop.
Граббер для сайта http://2photo.ru/ Переосмысленный https://gist.github.com/mebius01/5030198
#!/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