asp实现的7xi音乐网的采集源代码(14)


      set httpobj = server.createobject("paopao.http") 
      str0 = httpobj.get(tmp_url) 
      Err.Clear 
      on error resume next 
      str1 = split(str0,"<td width=""92%"">"&chr(13)) 
      str2 = split(str1(1),"                </td>") 
      lyric = str2(0) 
      lyric = replace(lyric,"<br>",chr(13)) 
      lyric = replace(lyric," "," ") 
      lyric = replace(replace(lyric,"<p>",""),"</p>","") 
      lyric = IndbStr(trim(lyric)) 
      if Instr(lyric,"mp3.baidu.com") then lyric = "暂时还没歌词"         

      if len(lyric) < 20 or Err <> 0 then 
        lyric = "暂时还没歌词" 
        response.write "<br>7xi自带歌词不完整,将采集baidu歌词" 
      end if 

      if lyric = "暂时还没歌词" then 
        Err.Clear 
        tmp_url = "http://mp3.baidu.com/m?f=ms&rn=10&tn=baidump3lyric&ct=150994944&word="&singer&"+"&song 
        response.write "<br>"&tmp_url 
        str0 = httpobj.get(tmp_url) 
        str1 = split(str0,"<B><font style=color:#e10900>"&song&"</font></B>") 
        if Ubound(str1) >= 1 then 
          str2 = split(str0,"<div style=""padding-left:10px;line-height:20px;padding-top:1px"">") 
          str3 = split(str2(1),"</div>") 
          lyric = str3(0) 
          lyric = replace(lyric,"<br>",chr(13)) 
          lyric = replace(lyric," "," ") 

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/3014.html