Forum Moderators: open
It takes a variable (xmlhttp.responseText) that holds an external page's source code, and checks it for the existance of a link to a specified domain. It should then show ONLY the HTML for that link, and then break it up in the sub strings.
What it DOES do currently, is return the whole string, EXCEPT the link it should, in effect doing the opposite.
Any help is appreciated. Source code i'm checking against to test is <snip> and looking for the link to <snip>
The VB code thus far:
url = objRSanc("la_blt_link_url")set xmlhttp = server.CreateObject("MSXML2.ServerXMLHTTP")
on error resume next
xmlhttp.open "GET", url, false
xmlhttp.send ""
if err.number <> 0 then
VerifyUrl=false
response.redirect("http://www.google.com/?0000000000000000000000")
else
set regizzo = New RegExp
regizzo.Pattern = "(<[^>]*?a[^>]*?(?:billiardsforum.info)[^>]*>)((?:.*?(?:<[ \r\t]*a[^>]*>?.*?(?:<.*?/.*?a.*?>)?)*)*)(<[^>]*?/[^>]*?a[^>]*?>)"
regizzo.Global = True
regizzo.IgnoreCase = True
dim stipulation
stipulation = regizzo.replace(xmlhttp.responseText, "$2")
response.write stipulation
Set regizzo = Nothing
dim updiz
Set updiz = Server.CreateObject("ADODB.Connection")
updiz.Open strdbee
Set objRSupd = Server.CreateObject("ADODB.RecordSet")
strsqlu = "UPDATE la_blt SET la_blt_link_anchor='somevar' WHERE la_blt_id =44"
objRSupd.Open strSQLu, updiz, adLockOptimistic
end if
response.write("done.")
%>
[edited by: engine at 4:17 pm (utc) on Aug. 14, 2006]
[edit reason]
[1][edit reason] No urls, thanks. See TOS [webmasterworld.com] [/edit] [/edit][/1]