Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Sobota, 14. jún 2025

Súbor: [Platon] / scripts / shell / zoznamka-fun / pokec / get-data.sh (stiahnutie)

Revízia 1.2, Thu Dec 20 16:29:21 2007 UTC (17 years, 5 months ago) by nepto


Zmeny od 1.1: +11 -8 [lines]

Reimplemented & several fixes

#!/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/
Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok