#!/bin/bash
#use wget to retrieve Main channel page with all thumbnail links
wget "http://www.youtube.com/user/ferrariworld?blend=1&ob=4#g/u"

#rename retrieved file to keep sanity. 
mv ferrariworld@blend=1&ob=4  ferrariExample.html

#retrieve only lines in the file that have the "watch" hyperlink
grep "<a href\\=\"/watch?v=" ferrariExample.html > vidList.txt

#process each line to get the substring watch portion 
for line in $(cat vidList.txt); 
do 
    test=`expr substr $line 1 50`; 
    echo $test | grep "href" >> output.txt; 
done

