Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- readonly PRE="http://www.blob.rai.it/dl/RaiTV/programmi/media/"
- readonly POST=".html#p=0"
- #First URL from which it gets the "weekly" URL
- url=$(wget -O- blob.rai.it | grep -oP '=http.?://\S+' | sed 's/=//;s/">//');
- #From the "weekly" URL it then filters 6 IDs
- paths=$(wget -O- $url | grep -A100 settimana | grep 'li id="C' | sed 's/" class=.*//' | sed -r 's/.{8}//')
- echo "$PRE""${paths}""$POST"
- #I know need to create variables made of "something"+$entryFrom$paths"+somethingElse" and then pass these new urls to wget
- # This is the line you suggested and im trying to adapt it
- while IFS=$'\n' read -d '' -ra pattern; do arr+=("$pattern"); done < <(wget -q -O- "$url" | grep "pattern"); printf '%s\n' "${arr[@]}"
- echo "URL="$url
- echo $url > lista #just for testing
- ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement