ID=$1 FILE=$(wget -e robots=off -q -O - "http://icm.tv.pionier.net.pl/Default.aspx?id=$ID") TMP=$(echo "$FILE"|tail -$(echo "$(echo "$FILE"|wc -l)-$(echo "$FILE"|grep -n "Tytuł materiału"|sed -e "s/://g"|awk '{print $1}')+1"|bc)); PART=$(echo "$TMP"|head -$(echo "$TMP"|grep -n "ctl00_content_DetailsControl1_RadPanelBar1_i0_i0_RadListView1_ClientState"|sed -e "s/://g"|awk '{print $1}'|head -1)); LIST=$(echo "$PART"| html2|grep -v "/html/body/div/@class="|grep -v "/html/body="|grep -v "/html/body/input/"|grep -v "/html/body/div/@style"|grep -v "/html/body/span/@style="|grep -v "/html/body/span/@id="|grep -v "/html/body/span/@class="|grep -v "/html/body/span/@title=") echo "title=$(echo "$LIST"|head -1|tail -1|sed -e "s/\/html\/body\/span\=//g" -e "s/^ *//g")" > $ID.properties echo "description=$(echo "$LIST"|head -2|tail -1|sed -e "s/\/html\/body\/div\=//g" -e "s/^ *//g")" >> $ID.properties METADATA=$(echo "$LIST"|grep -v "/html/body/div=") for I in 3 5 7 9 11 13 15 17 19 21 23 do ALL=$(echo "$METADATA"|head -$I|tail -2|sed -e "s/\/html\/body\/div\/span\=//g") case "$ALL" in *Forma:*) echo "form=$(echo "$ALL"|head -2|tail -1|sed -e "s/^ *//g")" >> $ID.properties ;; *Kategoria:*) echo "category=$(echo "$ALL"|head -2|tail -1|sed -e "s/^ *//g")" >> $ID.properties ;; *Dziedzina:*) echo "branch=$(echo "$ALL"|head -2|tail -1|sed -e "s/^ *//g")" >> $ID.properties ;; *Język:*) echo "language=$(echo "$ALL"|head -2|tail -1|sed -e "s/^ *//g")" >> $ID.properties ;; *Czas*trwania:*) echo "duration=$(echo "$ALL"|head -2|tail -1|sed -e "s/^ *//g")" >> $ID.properties ;; *Miejsce*powstania:*) echo "place-of-occurement=$(echo "$ALL"|head -2|tail -1|sed -e "s/^ *//g")" >> $ID.properties ;; *Autorzy:*) echo "autors=$(echo "$ALL"|head -2|tail -1|sed -e "s/^ *//g")" >> $ID.properties ;; *Dostawca:*) echo "supplier=$(echo "$ALL"|head -2|tail -1|sed -e "s/^ *//g")" >> $ID.properties ;; *Słowa*kluczowe:*) echo "key-words=$(echo "$ALL"|head -2|tail -1|sed -e "s/^ *//g")" >> $ID.properties ;; *Ograniczenie*wiekowe:*) echo "age-limits=$(echo "$ALL"|head -2|tail -1|sed -e "s/^ *//g")" >> $ID.properties ;; *Powiązane*adresy:*) echo "connected-address=$(echo "$ALL"|head -2|tail -1|sed -e "s/^ *//g")" >> $ID.properties ;; *) ;; esac done