Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2011
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.77 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. cd /home/tesla/dzRSS
  4.  
  5. for section in 0 1 2 3
  6. do
  7.     echo "sleeping before wgetting"
  8.     sleep 10
  9.     wget -q http://www.dniprowazirka.com.ua/list.php?r=$section -O -|grep -A 3 -B 3 "bulo_txt"|tr -d "\r\n"|sed -e 's/'"Далі..."'/\n/g'| while read line; do
  10.         title=$(echo $line|awk -F 'bulo_txt>' 'BEGIN{RS="</span"; OFS="\n"; ORS=""} {print $2}')
  11.         url=$(echo $line|awk -F '<a href=' 'BEGIN{RS="><"; OFS="\n"; ORS=""} {print $2}')
  12.         titleshort=$(echo $title|iconv -f utf-8 -t cp1251|cut -c1-96|iconv -f cp1251 -t utf-8)
  13.  
  14.         if [ ! -e $url ]
  15.         then
  16.         echo "sleeping before twitting"
  17.         sleep 15
  18.         echo "twitting"
  19.     ./tweetit.py "$titleshort http://dniprowazirka.com.ua/$url"
  20.     touch $url
  21.     fi
  22.  
  23.     done
  24. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement