#!/bin/sh
#
# go.sh
#
# Developed by Ondrej Jombik <nepto@in.nextra.sk>
# Copyright (c) 2007 Nextra Slovakia, Ltd., http://www.nextra.sk/
# Licensed under terms of GNU General Public License.
# All rights reserved.
#
# Changelog:
# 2007-12-13 - created
#
# $Platon: scripts/shell/zoznamka-fun/pokec/get-data.sh,v 1.1 2007-12-17 11:36:24 nepto Exp $
datafile="pokec.txt";
I9="777aa9afc309";
USER_AGENT="Mozilla/5.0"
COOKIE="uniqId=1187347886_46c57dae390b0; AZetSecId=393f42a15e; bSession=5e98d7e12312f9cc47206ae2f088bfdc; sSession=21c6ec36e57bf63f603743c8a4e2462d";
export I9 USER_AGENT COOKIE;
#source get-nick-type2.sh 2374963 # muz (special)
#source get-nick-type2.sh 8019553 # zena
#exit;
wget -O - \
--header "User-agent: $USER_AGENT" \
--header "Cookie: $COOKIE" \
"http://pokec.azet.sk/2/getpokecData.phtml?i9=$I9" \
2>/dev/null \
| grep -E -v '^<a.*</a>' \
| sed 's/*>/|/g' \
| ( \
write="";
while read line; do \
dttm="` echo \"$line\" | cut -f 1 -d \"|\" | sed 's/^\s*//g' `";
userid="` echo \"$line\" | cut -f 2 -d \"|\" | sed 's/^\s*//g' `";
nick="` echo \"$line\" | cut -f 3 -d \"|\" | sed 's/^\s*//g' `";
msg="` echo \"$line\" | cut -f 6 -d \"|\" `";
age="` source get-nick-type2.sh \"$userid\" `"; \
logline="$dttm $age $nick $msg";
echo "$logline";
if [ -n "$age" -a "$age" != "XX" ]; then \
if [ -z "$write" ]; then
grepline="` grep '^$dttm $age $nick' \"$datafile\" 2>/dev/null `";
if [ -z "$grepline" ]; then
#echo "ZEROLINE: $logline";
write="YES";
fi;
fi;
if [ -n "$write" ]; then
echo "$logline" >> "$datafile";
fi;
fi; \
done \
)
Platon Group <platon@platon.sk> http://platon.sk/
|