01-30-2008, 07:20 PM
I did not get much time today...created a crude one for you..will refine it tomorrow (if u want)
Changes you have to make :
1. Change maxRows to the number of searches in excel
2. list.xls is hardcoded as filename for now and location has to be on desktop
Changes you have to make :
1. Change maxRows to the number of searches in excel
2. list.xls is hardcoded as filename for now and location has to be on desktop
run "$Desktop$\list.xls" "" "Open" "" 3|0x100; err
int maxRows = 1 ;;181
str url_pre = "http://www.youtube.com/results?search_query="
str title artist url
str temp
str intresp result_url
Excel.Workbook x._getfile("$desktop$\list.xls")
Excel.Application a=x.Application
a.Visible=TRUE; err
ExcelSheet es.ws = x.Worksheets.Item(1)
int i
for(i 1 maxRows+1)
,es.SetCell("Connecting..." 3 i)
,es.GetCell(title 1 i)
,es.GetCell(artist 2 i)
,url.format("%s%s %s" url_pre title artist)
,IntGetFile url _s
,intresp = _s
,
,_i = find(intresp "a href=''/watch" 0 1)
,temp = _s.get(_s _i-1)
,
,;GET URL
,_i = find(temp ">" 0 1)
,result_url = temp.get(temp 9 _i-10)
,result_url - "http://www.youtube.com"
,
,es.SetCell(result_url 3 i)
es.Save
mes-("All links have been downloaded !" "Done" "ia")
IBM Mainframe Expert who Plays with QM a LOT !