Advertisement
Guest User

Untitled

a guest
May 24th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.67 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #First URL from which it gets the "weekly" URL
  4. url=$(wget -O- blob.rai.it | grep -oP '=http.?://\S+' | sed 's/=//;s/">//');
  5.  
  6. #From the "weekly" URL it then filters 6 IDs
  7. paths=$(wget -O- $url | grep -A100 settimana | grep 'li id="C' | sed 's/" class=.*//' | sed -r 's/.{8}//')
  8.  
  9. #I know need to create variables made of "something"+$entryFrom$paths"+somethingElse" and then pass these new urls to wget
  10.  
  11. # This is the line you suggested and im trying to adapt it
  12. while IFS=$'\n' read -d '' -ra pattern; do arr+=("$pattern"); done < <(wget -q -O- "$url" | grep "pattern"); printf '%s\n' "${arr[@]}"
  13.  
  14.  
  15.  
  16.  
  17. echo "URL="$url
  18.  
  19. echo $url > lista #just for testing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement