#!/bin/sh
#
# get-ids.sh - extract all IDs of advertisements
#
# Developed by Ondrej Jombik <nepto@platon.sk>
# Copyright (c) 2003 Platon SDG, http://platon.sk/
# Licensed under terms of GNU General Public License.
# All rights reserved.
#
# Changelog:
# 11/03/2002 - created
# 15/07/2003 - updated
#
# $Platon: get-ids.sh,v 1.1 2002/03/11 14:46:39 jombik9 Exp $
DEBUG=''; # '1' for debugging, '' otherwise
categories=`lynx -dump www.zoznamka.sk \
| awk 'BEGIN {FS="="} /inzeraty\.phtml.*kat/ {print $3}' \
| sed 's/&.*$//g'`
if [ "$DEBUG" ]; then
echo "Categories:";
echo "-----------";
echo "$categories";
fi
if [ "X" = "X$categories" ]; then
echo "no categories found";
exit;
fi
( for cat in $categories; do
for st in `seq 10`; do
s="http://zoznamka.azet.sk/inzeraty.phtml?&kat=$cat&all=1&tv=j&st=$st";
lynx -dump -noreferer "$s";
if [ "$DEBUG" ]; then
echo "[$s]";
fi
done
done ) \
| perl -wne '/c_inz=(\d*)[^\d]/ && print "$1\n";' \
| uniq
Platon Group <platon@platon.sk> http://platon.sk/
|