#!/bin/bash
id=$1
fm=/tmp/ttt
pictid=/tmp/pictid
ismaped=/tmp/ismaped
view=/tmp/view
url="http://www.panoramio.com/user/"$id"?photo_page="
wget --no-proxy "$url"1 -O $fm 2>/dev/null
i=2
isgo=`grep page=$i $fm`
while [ "${isgo}" != "" ]
do
grep "\"photo_[0-9]\+" $fm | sed "s/[^0-9]//g" >$pictid
#grep "title.*Earth" $fm | sed -e "s/title=//g" -e "s/ //g" -e "s/\"/ /g" >$ismaped
grep " view" $fm | sed "s/[^0-9]//g" >$view
paste -d" " $pictid $view
wget --no-proxy "${url}"$i -O $fm 2>/dev/null
i=$((i+1))
isgo=`grep page=$i $fm`
done
grep "\"photo_[0-9]\+" $fm | sed "s/[^0-9]//g" >$pictid
#grep "title.*Google Eart" $fm | sed -e "s/title=//g" -e "s/ //g" -e "s/\"/ /g" >$ismaped
grep " view" $fm | sed "s/[^0-9]//g" >$view
paste -d" " $pictid $view
用法:文件+用户名
shell语法不熟,写这点东西费不少劲……
id=$1
fm=/tmp/ttt
pictid=/tmp/pictid
ismaped=/tmp/ismaped
view=/tmp/view
url="http://www.panoramio.com/user/"$id"?photo_page="
wget --no-proxy "$url"1 -O $fm 2>/dev/null
i=2
isgo=`grep page=$i $fm`
while [ "${isgo}" != "" ]
do
grep "\"photo_[0-9]\+" $fm | sed "s/[^0-9]//g" >$pictid
#grep "title.*Earth" $fm | sed -e "s/title=//g" -e "s/ //g" -e "s/\"/ /g" >$ismaped
grep " view" $fm | sed "s/[^0-9]//g" >$view
paste -d" " $pictid $view
wget --no-proxy "${url}"$i -O $fm 2>/dev/null
i=$((i+1))
isgo=`grep page=$i $fm`
done
grep "\"photo_[0-9]\+" $fm | sed "s/[^0-9]//g" >$pictid
#grep "title.*Google Eart" $fm | sed -e "s/title=//g" -e "s/ //g" -e "s/\"/ /g" >$ismaped
grep " view" $fm | sed "s/[^0-9]//g" >$view
paste -d" " $pictid $view
用法:文件+用户名
shell语法不熟,写这点东西费不少劲……
没有评论:
发表评论