우선은 상품명에 대해서만 출력시켰는데, 이것을 각 상품에 대한 상품정보(가격,상품명,입
찰자 수 등..)에 대해서 각각을 디비에 넣어주는게 더 나을듯 싶네요. 너무 허접해서리...
스크립 첨 하시는 분은 참고만 하세요.
#-----------------------------------------------
#!/bin/sh
display(){
clear
echo "-------------------------------------"
echo "옥션(Auction) 상품검색기 V.10 by bug"
echo "bug_kill at hotmail.com echo "Search start..."
echo
date
echo "-------------------------------------"
}
auction="http://www.auction.co.kr/search/search.asp?ItemName=${2}"
esellpia="http://www.esale.co.kr/item/ItemList.jsp?name=Search&ItemSeq=&keyword1=${2}"
yahoo="http://kr.search.auctions.yahoo.com/search/auc?p=${2}"
if [ "$2" == "" ]
then
clear
echo "USAGE:./`basename $0` site[auction, yahoo, esellpia] 상품명"
exit 1
else
display
case "$1" in
"auction")
temp=$(lynx -source $auction | grep "detail_view" | sed -e 's/<[^>]+>//g' -e 's/ //g' -e 's/ //g');;
"esellpia")
temp=$(lynx -source $esellpia | grep "<td align=left bgcolor=" | sed -e 's/<[^>]+>//g' -e 's/ //g' -e 's/ //g');;
"yahoo")
temp=$(lynx -source $yahoo | grep "<tr bgcolor=eeeeee>" | sed -e 's/<[^>]+>//g' -e 's/ //g' -e 's/ //g');;
"goodsdaq")
esac
for i in ${temp[@]}
do echo $i
done
fi
exit 0