VB icon

Stealing Information from Another Web Page (

Email
Submitted on: 1/5/2015 6:03:00 AM
By: Kevin Reay (from psc cd)  
Level: Intermediate
User Rating: By 6 Users
Compatibility: ASP (Active Server Pages), VbScript (browser/client side)
Views: 849
 
     This code steals info/output from other pages! This can be used create meta-searches by grabing the output of other pages!!! For example, you could pass a search string into 2 existing pages and return the results to a single page!
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
'**************************************
' Name: Stealing Information from Another Web Page (
' Description:This code steals info/output from other pages! This can be used create meta-searches by grabing the output of other pages!!! For example, you could pass a search string into 2 existing pages and return the results to a single page!
' By: Kevin Reay (from psc cd)
'**************************************

<% Option Explicit %>
<%
Dim url'The URL to download
Dim sInfo 'string to hold the collected info
Dim sHTML 'String to hold HTML from download
Dim rReg 'var to hold regular expression
Dim objCols'Object to hold collections from Regular expression
Dim objMatch 'Object for matches
Dim inet 'Object for Inet Control
url = "WhatEverURL"
'Create instance of Inet Control
Set inet = Server.CreateObject("InetCtls.Inet")
'Set the timeout
inet.RequestTimeOut = 20
'Set the URL property of the control
inet.Url = url
'Actually download the file
sHTML = inet.OpenURL()
'Regular expression to find the string stored between
'the tags. This is where information is.
Set rReg = New regexp
'the TagGoesHere and EndTagGoesHere tags below represent
'the tags surrounding the information we want
'these tags can be more complex if required
rReg.Pattern = "TagGoesHere(.*)EndTagGoesHere"
rReg.Global = False
rReg.IgnoreCase = True
'Execute the regular expression on the raw HTML
Set objCols = rReg.Execute( sHTML )
'Step through our matches
For Each objMatch in objCols
	sInfo = sInfo & objMatch.Value
Next
'Clean up
Set rWorldPop = Nothing
Set objCols = Nothing
'Strip the TagGoesHere tags off of the info
sInfo = Replace(Replace(sInfo, "TagGoesHere", ""), "EndTagGoesHere", "")
%>
<HTML>
<HEAD>
<TITLE>Web output Stealer</TITLE>
</HEAD>
<BODY>
<P>The output of the page is: <%=sInfo %></P>
</BODY>
</HTML>


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.