понедельник, 17 мая 2010 г.

Russian Post Tracking script update

обновился сценарий для отслеживания международных почтовых отправлений. Основные изменения коснулись USPS и незначительные RUSSIAN POST.

USPS теперь выглядит так:
#############################next##########USPS################
echo $html_hr >> $index_h

/usr/local/bin/wget "http://trkcnfrm1.smi.usps.com/PTSInternetWeb/InterLabelInquiry.do?strOrigTrackNum=$post4" -O $index_t

/usr/bin/grep -i "Class:\|Receipt\ Number:\|Service(s):\|mainTextbold\|Your\ item\ was\|International\ " $index_t >> $index_h


RUSSIAN POST выглядит так:
#######################################RUSSIAN#POST##########
#
/usr/local/bin/wget "http://info.russianpost.ru/servlet/post_item?action=search&searchType=barCode&show_form=yes&barCode=$post4&page=1" -O $index_t

/usr/bin/grep -i "table\|td\|tr\|STYLESHEET\|$post4" $index_t | /usr/bin/grep -i -v "Dmitry\|Transitional\|pageTracker\|{" > $tmp_fil

/bin/cat $tmp_fil | sed -e 's/\.\.\/css\///g' >> $index_h

Переменная $post4 это как обычно международный почтовый идентификатор отправления, в формате:
post4=LC123456789US

Комментариев нет: